Skip to content

Commit 0cfb153

Browse files
authored
ci(pypi): split the PyPI release process (#463)
Related to packit/private#32
2 parents 875f03e + c93c042 commit 0cfb153

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,54 @@ name: Publish Python 🐍 distributions 📦 to PyPI
55

66
on:
77
release:
8+
# • `released` reacts to stable releases
9+
# • `prereleased` reacts to pre-releases
10+
# • `published` reacts to both
811
types: [published]
912

1013
jobs:
11-
build-n-publish:
14+
build:
15+
name: Build distribution 📦
1216
runs-on: ubuntu-latest
13-
permissions:
14-
id-token: write # for trusted publishing
1517

1618
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-python@v4
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-tags: true
22+
persist-credentials: false
23+
24+
- uses: actions/setup-python@v5
1925

2026
- name: Build a source tarball and a binary wheel
2127
# https://pypa-build.readthedocs.io
2228
run: |
2329
python -m pip install build
2430
python -m build
2531
32+
- name: Store the distribution packages
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: python-package-distributions
36+
path: dist/
37+
38+
publish:
39+
name: Publish Python 🐍 distribution 📦 to PyPI
40+
needs:
41+
- build
42+
runs-on: ubuntu-latest
43+
environment:
44+
name: pypi
45+
url: https://pypi.org/project/specfile/
46+
permissions:
47+
id-token: write # for trusted publishing
48+
49+
steps:
50+
- name: Download all the dists
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: python-package-distributions
54+
path: dist/
55+
2656
- name: Publish 📦 to PyPI
2757
# https://github.com/pypa/gh-action-pypi-publish
2858
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)