Skip to content

Commit ba43ea1

Browse files
committed
Update CI jobs
1 parent 8e7315c commit ba43ea1

File tree

1 file changed

+103
-32
lines changed

1 file changed

+103
-32
lines changed

.github/workflows/python.yml

Lines changed: 103 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is autogenerated by maturin v1.0.1
1+
# This file is autogenerated by maturin v1.8.2
22
# To update, run
33
#
44
# maturin generate-ci github -o ../.github/workflows/python.yml
@@ -20,84 +20,155 @@ permissions:
2020

2121
jobs:
2222
linux:
23-
runs-on: ubuntu-latest
23+
runs-on: ${{ matrix.platform.runner }}
2424
strategy:
2525
matrix:
2626
target: [x86_64, x86]
27+
platform:
28+
- runner: ubuntu-22.04
29+
target: x86_64
30+
- runner: ubuntu-22.04
31+
target: x86
2732
steps:
28-
- uses: actions/checkout@v3
29-
- uses: actions/setup-python@v4
33+
- uses: actions/checkout@v4
34+
- uses: actions/setup-python@v5
3035
with:
31-
python-version: '3.12'
36+
python-version: 3.x
3237
- name: Build wheels
3338
uses: PyO3/maturin-action@v1
3439
with:
35-
target: ${{ matrix.target }}
40+
target: ${{ matrix.platform.target }}
3641
args: --release --out dist --find-interpreter -m python/Cargo.toml
37-
sccache: 'true'
42+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
3843
manylinux: auto
3944
- name: Upload wheels
40-
uses: actions/upload-artifact@v3
45+
uses: actions/upload-artifact@v4
4146
with:
42-
name: wheels
47+
name: wheels-linux-${{ matrix.platform.target }}
48+
path: dist
49+
50+
musllinux:
51+
runs-on: ${{ matrix.platform.runner }}
52+
strategy:
53+
matrix:
54+
platform:
55+
- runner: ubuntu-22.04
56+
target: x86_64
57+
- runner: ubuntu-22.04
58+
target: x86
59+
- runner: ubuntu-22.04
60+
target: aarch64
61+
- runner: ubuntu-22.04
62+
target: armv7
63+
steps:
64+
- uses: actions/checkout@v4
65+
- uses: actions/setup-python@v5
66+
with:
67+
python-version: 3.x
68+
- name: Build wheels
69+
uses: PyO3/maturin-action@v1
70+
with:
71+
target: ${{ matrix.platform.target }}
72+
args: --release --out dist --find-interpreter -m python/Cargo.toml
73+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
74+
manylinux: musllinux_1_2
75+
- name: Upload wheels
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: wheels-musllinux-${{ matrix.platform.target }}
4379
path: dist
4480

4581
windows:
46-
runs-on: windows-latest
82+
runs-on: ${{ matrix.platform.runner }}
4783
strategy:
4884
matrix:
49-
target: [x64, x86]
85+
platform:
86+
- runner: windows-latest
87+
target: x64
88+
- runner: windows-latest
89+
target: x86
5090
steps:
51-
- uses: actions/checkout@v3
52-
- uses: actions/setup-python@v4
91+
- uses: actions/checkout@v4
92+
- uses: actions/setup-python@v5
5393
with:
54-
python-version: '3.12'
55-
architecture: ${{ matrix.target }}
94+
python-version: 3.x
95+
architecture: ${{ matrix.platform.target }}
5696
- name: Build wheels
5797
uses: PyO3/maturin-action@v1
5898
with:
59-
target: ${{ matrix.target }}
99+
target: ${{ matrix.platform.target }}
60100
args: --release --out dist --find-interpreter -m python/Cargo.toml
61-
sccache: 'true'
101+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
62102
- name: Upload wheels
63-
uses: actions/upload-artifact@v3
103+
uses: actions/upload-artifact@v4
64104
with:
65-
name: wheels
105+
name: wheels-windows-${{ matrix.platform.target }}
66106
path: dist
67107

68108
macos:
69-
runs-on: macos-latest
109+
runs-on: ${{ matrix.platform.runner }}
70110
strategy:
71111
matrix:
72-
target: [x86_64, aarch64]
112+
platform:
113+
- runner: macos-13
114+
target: x86_64
115+
- runner: macos-14
116+
target: aarch64
73117
steps:
74-
- uses: actions/checkout@v3
75-
- uses: actions/setup-python@v4
118+
- uses: actions/checkout@v4
119+
- uses: actions/setup-python@v5
76120
with:
77-
python-version: '3.12'
121+
python-version: 3.x
78122
- name: Build wheels
79123
uses: PyO3/maturin-action@v1
80124
with:
81-
target: ${{ matrix.target }}
125+
target: ${{ matrix.platform.target }}
82126
args: --release --out dist --find-interpreter -m python/Cargo.toml
83-
sccache: 'true'
127+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
84128
- name: Upload wheels
85-
uses: actions/upload-artifact@v3
129+
uses: actions/upload-artifact@v4
86130
with:
87-
name: wheels
131+
name: wheels-macos-${{ matrix.platform.target }}
88132
path: dist
89133

90134
sdist:
91135
runs-on: ubuntu-latest
92136
steps:
93-
- uses: actions/checkout@v3
137+
- uses: actions/checkout@v4
94138
- name: Build sdist
95139
uses: PyO3/maturin-action@v1
96140
with:
97141
command: sdist
98-
args: --out dist -m python/Cargo.toml
142+
args: --out dist
99143
- name: Upload sdist
100-
uses: actions/upload-artifact@v3
144+
uses: actions/upload-artifact@v4
101145
with:
102-
name: wheels
146+
name: wheels-sdist
103147
path: dist
148+
149+
release:
150+
name: Release
151+
runs-on: ubuntu-latest
152+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
153+
needs: [linux, musllinux, windows, macos, sdist]
154+
permissions:
155+
# Use to sign the release artifacts
156+
id-token: write
157+
# Used to upload release artifacts
158+
contents: write
159+
# Used to generate artifact attestation
160+
attestations: write
161+
steps:
162+
- uses: actions/download-artifact@v4
163+
- name: Generate artifact attestation
164+
uses: actions/attest-build-provenance@v1
165+
with:
166+
subject-path: 'wheels-*/*'
167+
- name: Publish to PyPI
168+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
169+
uses: PyO3/maturin-action@v1
170+
env:
171+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
172+
with:
173+
command: upload
174+
args: --non-interactive --skip-existing wheels-*/*

0 commit comments

Comments
 (0)