Skip to content

Commit ed99214

Browse files
committed
try maturin build actions
1 parent 4d2812f commit ed99214

File tree

1 file changed

+170
-0
lines changed

1 file changed

+170
-0
lines changed

.github/workflows/maturin_builds.yml

+170
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
name: maturin builds
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
linux:
12+
runs-on: ${{ matrix.platform.runner }}
13+
strategy:
14+
matrix:
15+
platform:
16+
- runner: ubuntu-latest
17+
target: x86_64
18+
- runner: ubuntu-latest
19+
target: x86
20+
- runner: ubuntu-latest
21+
target: aarch64
22+
- runner: ubuntu-latest
23+
target: armv7
24+
- runner: ubuntu-latest
25+
target: s390x
26+
- runner: ubuntu-latest
27+
target: ppc64le
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: 3.x
33+
- name: Build wheels
34+
uses: PyO3/maturin-action@v1
35+
with:
36+
target: ${{ matrix.platform.target }}
37+
args: --release --out dist --find-interpreter
38+
sccache: 'true'
39+
manylinux: auto
40+
- name: Upload wheels
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: wheels-linux-${{ matrix.platform.target }}
44+
path: dist
45+
46+
musllinux:
47+
runs-on: ${{ matrix.platform.runner }}
48+
strategy:
49+
matrix:
50+
platform:
51+
- runner: ubuntu-latest
52+
target: x86_64
53+
- runner: ubuntu-latest
54+
target: x86
55+
- runner: ubuntu-latest
56+
target: aarch64
57+
- runner: ubuntu-latest
58+
target: armv7
59+
steps:
60+
- uses: actions/checkout@v4
61+
- uses: actions/setup-python@v5
62+
with:
63+
python-version: 3.x
64+
- name: Build wheels
65+
uses: PyO3/maturin-action@v1
66+
with:
67+
target: ${{ matrix.platform.target }}
68+
args: --release --out dist --find-interpreter
69+
sccache: 'true'
70+
manylinux: musllinux_1_2
71+
- name: Upload wheels
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: wheels-musllinux-${{ matrix.platform.target }}
75+
path: dist
76+
77+
windows:
78+
runs-on: ${{ matrix.platform.runner }}
79+
strategy:
80+
matrix:
81+
platform:
82+
- runner: windows-latest
83+
target: x64
84+
- runner: windows-latest
85+
target: x86
86+
steps:
87+
- uses: actions/checkout@v4
88+
- uses: actions/setup-python@v5
89+
with:
90+
python-version: 3.x
91+
architecture: ${{ matrix.platform.target }}
92+
- name: Build wheels
93+
uses: PyO3/maturin-action@v1
94+
with:
95+
target: ${{ matrix.platform.target }}
96+
args: --release --out dist --find-interpreter
97+
sccache: 'true'
98+
- name: Upload wheels
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: wheels-windows-${{ matrix.platform.target }}
102+
path: dist
103+
104+
macos:
105+
runs-on: ${{ matrix.platform.runner }}
106+
strategy:
107+
matrix:
108+
platform:
109+
- runner: macos-12
110+
target: x86_64
111+
- runner: macos-14
112+
target: aarch64
113+
steps:
114+
- uses: actions/checkout@v4
115+
- uses: actions/setup-python@v5
116+
with:
117+
python-version: 3.x
118+
- name: Build wheels
119+
uses: PyO3/maturin-action@v1
120+
with:
121+
target: ${{ matrix.platform.target }}
122+
args: --release --out dist --find-interpreter
123+
sccache: 'true'
124+
- name: Upload wheels
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: wheels-macos-${{ matrix.platform.target }}
128+
path: dist
129+
130+
sdist:
131+
runs-on: ubuntu-latest
132+
steps:
133+
- uses: actions/checkout@v4
134+
- name: Build sdist
135+
uses: PyO3/maturin-action@v1
136+
with:
137+
command: sdist
138+
args: --out dist
139+
- name: Upload sdist
140+
uses: actions/upload-artifact@v4
141+
with:
142+
name: wheels-sdist
143+
path: dist
144+
145+
# release:
146+
# name: Release
147+
# runs-on: ubuntu-latest
148+
# if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
149+
# needs: [linux, musllinux, windows, macos, sdist]
150+
# permissions:
151+
# # Use to sign the release artifacts
152+
# id-token: write
153+
# # Used to upload release artifacts
154+
# contents: write
155+
# # Used to generate artifact attestation
156+
# attestations: write
157+
# steps:
158+
# - uses: actions/download-artifact@v4
159+
# - name: Generate artifact attestation
160+
# uses: actions/attest-build-provenance@v1
161+
# with:
162+
# subject-path: 'wheels-*/*'
163+
# - name: Publish to PyPI
164+
# if: "startsWith(github.ref, 'refs/tags/')"
165+
# uses: PyO3/maturin-action@v1
166+
# env:
167+
# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
168+
# with:
169+
# command: upload
170+
# args: --non-interactive --skip-existing wheels-*/*

0 commit comments

Comments
 (0)