Skip to content

Commit 5af19fe

Browse files
committed
Update maturin upload workflow
1 parent 79585c9 commit 5af19fe

1 file changed

Lines changed: 89 additions & 28 deletions

File tree

.github/workflows/maturin_upload_pypi.yml

Lines changed: 89 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is autogenerated by maturin v1.2.3
1+
# This file is autogenerated by maturin v1.8.2
22
# To update, run
33
#
44
# maturin generate-ci github
@@ -15,71 +15,122 @@ permissions:
1515

1616
jobs:
1717
linux:
18-
runs-on: ubuntu-latest
18+
runs-on: ${{ matrix.platform.runner }}
1919
strategy:
2020
matrix:
21-
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
21+
platform:
22+
- runner: ubuntu-22.04
23+
target: x86_64
24+
- runner: ubuntu-22.04
25+
target: x86
26+
- runner: ubuntu-22.04
27+
target: aarch64
28+
- runner: ubuntu-22.04
29+
target: armv7
30+
- runner: ubuntu-22.04
31+
target: s390x
32+
- runner: ubuntu-22.04
33+
target: ppc64le
2234
steps:
2335
- uses: actions/checkout@v4
24-
- uses: actions/setup-python@v4
36+
- uses: actions/setup-python@v5
2537
with:
26-
python-version: '3.13'
38+
python-version: 3.x
2739
- name: Build wheels
2840
uses: PyO3/maturin-action@v1
2941
with:
30-
target: ${{ matrix.target }}
42+
target: ${{ matrix.platform.target }}
3143
args: --release --out dist --find-interpreter
32-
sccache: 'true'
44+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
3345
manylinux: auto
3446
- name: Upload wheels
3547
uses: actions/upload-artifact@v4
3648
with:
37-
name: wheels
49+
name: wheels-linux-${{ matrix.platform.target }}
50+
path: dist
51+
52+
musllinux:
53+
runs-on: ${{ matrix.platform.runner }}
54+
strategy:
55+
matrix:
56+
platform:
57+
- runner: ubuntu-22.04
58+
target: x86_64
59+
- runner: ubuntu-22.04
60+
target: x86
61+
- runner: ubuntu-22.04
62+
target: aarch64
63+
- runner: ubuntu-22.04
64+
target: armv7
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: actions/setup-python@v5
68+
with:
69+
python-version: 3.x
70+
- name: Build wheels
71+
uses: PyO3/maturin-action@v1
72+
with:
73+
target: ${{ matrix.platform.target }}
74+
args: --release --out dist --find-interpreter
75+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
76+
manylinux: musllinux_1_2
77+
- name: Upload wheels
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: wheels-musllinux-${{ matrix.platform.target }}
3881
path: dist
3982

4083
windows:
41-
runs-on: windows-latest
84+
runs-on: ${{ matrix.platform.runner }}
4285
strategy:
4386
matrix:
44-
target: [x64, x86]
87+
platform:
88+
- runner: windows-latest
89+
target: x64
90+
- runner: windows-latest
91+
target: x86
4592
steps:
4693
- uses: actions/checkout@v4
47-
- uses: actions/setup-python@v4
94+
- uses: actions/setup-python@v5
4895
with:
49-
python-version: '3.13'
50-
architecture: ${{ matrix.target }}
96+
python-version: 3.x
97+
architecture: ${{ matrix.platform.target }}
5198
- name: Build wheels
5299
uses: PyO3/maturin-action@v1
53100
with:
54-
target: ${{ matrix.target }}
101+
target: ${{ matrix.platform.target }}
55102
args: --release --out dist --find-interpreter
56-
sccache: 'true'
103+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
57104
- name: Upload wheels
58105
uses: actions/upload-artifact@v4
59106
with:
60-
name: wheels
107+
name: wheels-windows-${{ matrix.platform.target }}
61108
path: dist
62109

63110
macos:
64-
runs-on: macos-latest
111+
runs-on: ${{ matrix.platform.runner }}
65112
strategy:
66113
matrix:
67-
target: [x86_64, aarch64]
114+
platform:
115+
- runner: macos-13
116+
target: x86_64
117+
- runner: macos-14
118+
target: aarch64
68119
steps:
69120
- uses: actions/checkout@v4
70-
- uses: actions/setup-python@v4
121+
- uses: actions/setup-python@v5
71122
with:
72-
python-version: '3.13'
123+
python-version: 3.x
73124
- name: Build wheels
74125
uses: PyO3/maturin-action@v1
75126
with:
76-
target: ${{ matrix.target }}
127+
target: ${{ matrix.platform.target }}
77128
args: --release --out dist --find-interpreter
78-
sccache: 'true'
129+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
79130
- name: Upload wheels
80131
uses: actions/upload-artifact@v4
81132
with:
82-
name: wheels
133+
name: wheels-macos-${{ matrix.platform.target }}
83134
path: dist
84135

85136
sdist:
@@ -94,7 +145,7 @@ jobs:
94145
- name: Upload sdist
95146
uses: actions/upload-artifact@v4
96147
with:
97-
name: wheels
148+
name: wheels-sdist
98149
path: dist
99150

100151
check_clippy_python_bindings:
@@ -120,16 +171,26 @@ jobs:
120171
release:
121172
name: Release
122173
runs-on: ubuntu-latest
123-
if: "startsWith(github.ref, 'refs/tags/')"
124-
needs: [linux, windows, macos, sdist, check_clippy_python_bindings]
174+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
175+
needs: [linux, musllinux, windows, macos, sdist, check_clippy_python_bindings]
176+
permissions:
177+
# Use to sign the release artifacts
178+
id-token: write
179+
# Used to upload release artifacts
180+
contents: write
181+
# Used to generate artifact attestation
182+
attestations: write
125183
steps:
126184
- uses: actions/download-artifact@v4
185+
- name: Generate artifact attestation
186+
uses: actions/attest-build-provenance@v1
127187
with:
128-
name: wheels
188+
subject-path: 'wheels-*/*'
129189
- name: Publish to PyPI
190+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
130191
uses: PyO3/maturin-action@v1
131192
env:
132193
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
133194
with:
134195
command: upload
135-
args: --non-interactive --skip-existing *
196+
args: --non-interactive --skip-existing wheels-*/*

0 commit comments

Comments
 (0)