Skip to content

Commit ead594c

Browse files
committed
chore: separte workflow into build and publish steps
1 parent 93ce40e commit ead594c

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/publish-to-pypi.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
---
2-
permissions:
3-
contents: read
42
name: PyPI
53
on: push
64
jobs:
7-
build-n-publish:
8-
name: Build and publish optimagic Python 🐍 distributions 📦 to PyPI
5+
build:
6+
name: Build distribution
97
runs-on: ubuntu-latest
108
permissions:
119
contents: read
12-
id-token: write
1310
steps:
1411
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1512
with:
@@ -31,6 +28,23 @@ jobs:
3128
--sdist
3229
--wheel
3330
--outdir dist/
34-
- name: Publish distribution 📦 to PyPI
35-
if: startsWith(github.ref, 'refs/tags')
31+
- name: Upload distribution artifacts
32+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
33+
with:
34+
name: dist
35+
path: dist
36+
publish:
37+
name: Publish to PyPI
38+
if: startsWith(github.ref, 'refs/tags')
39+
needs: build
40+
runs-on: ubuntu-latest
41+
permissions:
42+
id-token: write
43+
steps:
44+
- name: Download distribution artifacts
45+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
46+
with:
47+
name: dist
48+
path: dist
49+
- name: Publish distribution to PyPI
3650
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e

0 commit comments

Comments
 (0)