Skip to content

Commit 30e5259

Browse files
committed
Fix: Separate build and publish jobs for cross-platform release
1 parent 2fa248a commit 30e5259

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

.github/workflows/release.yaml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ permissions:
99
contents: read
1010

1111
jobs:
12-
release:
13-
name: Release
12+
build:
13+
name: Build wheels on ${{ matrix.os }}
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
matrix:
@@ -23,10 +23,34 @@ jobs:
2323
with:
2424
python-version: '3.11'
2525

26-
- name: Build and upload to PyPI
26+
- name: Build wheels
2727
uses: PyO3/maturin-action@v1
2828
with:
29-
command: upload
30-
args: --release --out dist
29+
command: build
30+
args: --release --out dist --sdist
31+
32+
- name: Upload wheels to GitHub
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: wheels-${{ matrix.os }}
36+
path: dist
37+
38+
release:
39+
name: Release to PyPI
40+
runs-on: ubuntu-latest
41+
needs: [build]
42+
steps:
43+
- name: Download all wheels
44+
uses: actions/download-artifact@v4
45+
with:
46+
pattern: wheels-*
47+
path: dist
48+
merge-multiple: true
49+
50+
- name: Publish to PyPI
51+
uses: PyO3/maturin-action@v1
3152
env:
32-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
53+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
54+
with:
55+
command: upload
56+
args: --non-interactive --skip-existing dist/*

0 commit comments

Comments
 (0)