Skip to content

Commit 340964d

Browse files
Merge pull request #4 from betterproto/update-workflow
Update workflow
2 parents b9741e2 + 017e94e commit 340964d

File tree

1 file changed

+125
-38
lines changed

1 file changed

+125
-38
lines changed

.github/workflows/CI.yml

Lines changed: 125 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is autogenerated by maturin v1.3.2
1+
# This file is autogenerated by maturin v1.7.8
22
# To update, run
33
#
44
# maturin generate-ci github
@@ -20,101 +20,188 @@ permissions:
2020

2121
jobs:
2222
linux:
23-
runs-on: ubuntu-latest
23+
runs-on: ${{ matrix.platform.runner }}
2424
strategy:
2525
matrix:
26-
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
26+
platform:
27+
- runner: ubuntu-22.04
28+
target: x86_64
29+
- runner: ubuntu-22.04
30+
target: x86
31+
- runner: ubuntu-22.04
32+
target: aarch64
33+
- runner: ubuntu-22.04
34+
target: armv7
35+
- runner: ubuntu-22.04
36+
target: s390x
37+
- runner: ubuntu-22.04
38+
target: ppc64le
2739
steps:
28-
- uses: actions/checkout@v3
29-
- uses: actions/setup-python@v4
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-python@v5
3042
with:
31-
python-version: '3.10'
43+
python-version: 3.x
3244
- name: Build wheels
3345
uses: PyO3/maturin-action@v1
3446
with:
35-
target: ${{ matrix.target }}
36-
args: --release --out dist --find-interpreter
47+
target: ${{ matrix.platform.target }}
48+
args: --release --out dist
3749
sccache: 'true'
3850
manylinux: auto
51+
- name: Build free-threaded wheels
52+
uses: PyO3/maturin-action@v1
53+
with:
54+
target: ${{ matrix.platform.target }}
55+
args: --release --out dist -i python3.13t
56+
sccache: 'true'
57+
manylinux: auto
58+
- name: Upload wheels
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: wheels-linux-${{ matrix.platform.target }}
62+
path: dist
63+
64+
musllinux:
65+
runs-on: ${{ matrix.platform.runner }}
66+
strategy:
67+
matrix:
68+
platform:
69+
- runner: ubuntu-22.04
70+
target: x86_64
71+
- runner: ubuntu-22.04
72+
target: x86
73+
- runner: ubuntu-22.04
74+
target: aarch64
75+
- runner: ubuntu-22.04
76+
target: armv7
77+
steps:
78+
- uses: actions/checkout@v4
79+
- uses: actions/setup-python@v5
80+
with:
81+
python-version: 3.x
82+
- name: Build wheels
83+
uses: PyO3/maturin-action@v1
84+
with:
85+
target: ${{ matrix.platform.target }}
86+
args: --release --out dist
87+
sccache: 'true'
88+
manylinux: musllinux_1_2
89+
- name: Build free-threaded wheels
90+
uses: PyO3/maturin-action@v1
91+
with:
92+
target: ${{ matrix.platform.target }}
93+
args: --release --out dist -i python3.13t
94+
sccache: 'true'
95+
manylinux: musllinux_1_2
3996
- name: Upload wheels
40-
uses: actions/upload-artifact@v3
97+
uses: actions/upload-artifact@v4
4198
with:
42-
name: wheels
99+
name: wheels-musllinux-${{ matrix.platform.target }}
43100
path: dist
44101

45102
windows:
46-
runs-on: windows-latest
103+
runs-on: ${{ matrix.platform.runner }}
47104
strategy:
48105
matrix:
49-
target: [x64, x86]
106+
platform:
107+
- runner: windows-latest
108+
target: x64
109+
- runner: windows-latest
110+
target: x86
50111
steps:
51-
- uses: actions/checkout@v3
52-
- uses: actions/setup-python@v4
112+
- uses: actions/checkout@v4
113+
- uses: actions/setup-python@v5
53114
with:
54-
python-version: '3.10'
55-
architecture: ${{ matrix.target }}
115+
python-version: 3.x
116+
architecture: ${{ matrix.platform.target }}
56117
- name: Build wheels
57118
uses: PyO3/maturin-action@v1
58119
with:
59-
target: ${{ matrix.target }}
60-
args: --release --out dist --find-interpreter
120+
target: ${{ matrix.platform.target }}
121+
args: --release --out dist
122+
sccache: 'true'
123+
- name: Build free-threaded wheels
124+
uses: PyO3/maturin-action@v1
125+
with:
126+
target: ${{ matrix.platform.target }}
127+
args: --release --out dist -i python3.13t
61128
sccache: 'true'
62129
- name: Upload wheels
63-
uses: actions/upload-artifact@v3
130+
uses: actions/upload-artifact@v4
64131
with:
65-
name: wheels
132+
name: wheels-windows-${{ matrix.platform.target }}
66133
path: dist
67134

68135
macos:
69-
runs-on: macos-latest
136+
runs-on: ${{ matrix.platform.runner }}
70137
strategy:
71138
matrix:
72-
target: [x86_64, aarch64]
139+
platform:
140+
- runner: macos-13
141+
target: x86_64
142+
- runner: macos-14
143+
target: aarch64
73144
steps:
74-
- uses: actions/checkout@v3
75-
- uses: actions/setup-python@v4
145+
- uses: actions/checkout@v4
146+
- uses: actions/setup-python@v5
76147
with:
77-
python-version: '3.10'
148+
python-version: 3.x
78149
- name: Build wheels
79150
uses: PyO3/maturin-action@v1
80151
with:
81-
target: ${{ matrix.target }}
82-
args: --release --out dist --find-interpreter
152+
target: ${{ matrix.platform.target }}
153+
args: --release --out dist
154+
sccache: 'true'
155+
- name: Build free-threaded wheels
156+
uses: PyO3/maturin-action@v1
157+
with:
158+
target: ${{ matrix.platform.target }}
159+
args: --release --out dist -i python3.13t
83160
sccache: 'true'
84161
- name: Upload wheels
85-
uses: actions/upload-artifact@v3
162+
uses: actions/upload-artifact@v4
86163
with:
87-
name: wheels
164+
name: wheels-macos-${{ matrix.platform.target }}
88165
path: dist
89166

90167
sdist:
91168
runs-on: ubuntu-latest
92169
steps:
93-
- uses: actions/checkout@v3
170+
- uses: actions/checkout@v4
94171
- name: Build sdist
95172
uses: PyO3/maturin-action@v1
96173
with:
97174
command: sdist
98175
args: --out dist
99176
- name: Upload sdist
100-
uses: actions/upload-artifact@v3
177+
uses: actions/upload-artifact@v4
101178
with:
102-
name: wheels
179+
name: wheels-sdist
103180
path: dist
104181

105182
release:
106183
name: Release
107184
runs-on: ubuntu-latest
108-
if: "startsWith(github.ref, 'refs/tags/')"
109-
needs: [linux, windows, macos, sdist]
185+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
186+
needs: [linux, musllinux, windows, macos, sdist]
187+
permissions:
188+
# Use to sign the release artifacts
189+
id-token: write
190+
# Used to upload release artifacts
191+
contents: write
192+
# Used to generate artifact attestation
193+
attestations: write
110194
steps:
111-
- uses: actions/download-artifact@v3
195+
- uses: actions/download-artifact@v4
196+
- name: Generate artifact attestation
197+
uses: actions/attest-build-provenance@v1
112198
with:
113-
name: wheels
199+
subject-path: 'wheels-*/*'
114200
- name: Publish to PyPI
201+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
115202
uses: PyO3/maturin-action@v1
116203
env:
117-
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
204+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
118205
with:
119206
command: upload
120-
args: --non-interactive --skip-existing *
207+
args: --non-interactive --skip-existing wheels-*/*

0 commit comments

Comments
 (0)