Skip to content

Commit b8cc606

Browse files
split publish and uploading to different jobs
1 parent 7b25f06 commit b8cc606

File tree

1 file changed

+42
-8
lines changed

1 file changed

+42
-8
lines changed

.github/workflows/python-publish.yml

+42-8
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@ permissions:
1818
contents: write
1919

2020
jobs:
21-
deploy:
21+
build:
22+
name: Build and upload artifacts
2223
runs-on: ubuntu-latest
23-
permissions:
24-
# IMPORTANT: this permission is mandatory for trusted publishing
25-
id-token: write
26-
contents: write
27-
2824
steps:
2925
- uses: actions/checkout@v4
3026
- name: Set up Python
@@ -38,10 +34,48 @@ jobs:
3834
pip install build
3935
- name: Build package
4036
run: python -m build
37+
38+
- name: Upload artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: wheels
42+
path: dist/
43+
44+
publish:
45+
needs: build
46+
runs-on: ubuntu-latest
47+
permissions:
48+
# IMPORTANT: this permission is mandatory for trusted publishing
49+
id-token: write
50+
51+
steps:
52+
- name: Download artifact
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: wheels
56+
path: dist
57+
4158
- name: Publish package
4259
uses: pypa/gh-action-pypi-publish@release/v1
43-
44-
- name: Upload Release Asset
60+
with:
61+
packages-dir: dist/
62+
63+
release:
64+
name: Upload Release Asset
65+
needs: build
66+
runs-on: ubuntu-latest
67+
68+
permissions:
69+
contents: write
70+
71+
steps:
72+
- name: Download artifact
73+
uses: actions/download-artifact@v4
74+
with:
75+
name: wheels
76+
path: dist
77+
78+
- name: Upload release assets
4579
uses: xresloader/upload-to-github-release@v1
4680
env:
4781
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)