Skip to content

Commit 82817d1

Browse files
committed
Update GitHub Actions and build requirements to use maturin and pip to setup
1 parent 76d76cd commit 82817d1

File tree

4 files changed

+123
-188
lines changed

4 files changed

+123
-188
lines changed

.github/workflows/publish.yml

Lines changed: 77 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -7,184 +7,124 @@ on:
77

88
jobs:
99

10-
wheel-linux-aarch64:
11-
name: Build Linux wheels (Aarch64)
12-
runs-on: ubuntu-22.04
13-
strategy:
14-
matrix:
15-
python-tag:
16-
- cp37-manylinux_aarch64
17-
- cp38-manylinux_aarch64
18-
- cp39-manylinux_aarch64
19-
- cp310-manylinux_aarch64
20-
- cp311-manylinux_aarch64
21-
- cp312-manylinux_aarch64
22-
- pp37-manylinux_aarch64
23-
- pp38-manylinux_aarch64
24-
- pp39-manylinux_aarch64
25-
- pp310-manylinux_aarch64
26-
steps:
27-
- uses: actions/checkout@v3
28-
- name: Set up QEMU
29-
id: qemu
30-
uses: docker/setup-qemu-action@v2
31-
with:
32-
platforms: all
33-
- name: Build manylinux wheels
34-
uses: pypa/cibuildwheel@v2.16.2
35-
env:
36-
CIBW_ARCHS: aarch64
37-
CIBW_BUILD: ${{ matrix.python-tag }}
38-
CIBW_BEFORE_ALL: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y"
39-
CIBW_BUILD_VERBOSITY: 2
40-
CIBW_ENVIRONMENT: CARGO_NET_GIT_FETCH_WITH_CLI=true
41-
with:
42-
output-dir: dist
43-
- uses: actions/upload-artifact@v3
44-
with:
45-
name: wheels
46-
path: dist/*
10+
# wheel-linux-aarch64:
11+
# name: Build Linux wheels (Aarch64)
12+
# runs-on: ubuntu-latest
13+
# if: "startsWith(github.ref, 'refs/tags/v')"
14+
# steps:
15+
# - uses: actions/checkout@v4
16+
# - name: Set up QEMU
17+
# id: qemu
18+
# uses: docker/setup-qemu-action@v3
19+
# with:
20+
# platforms: all
21+
# - name: Build manylinux wheels
22+
# uses: pypa/cibuildwheel@v2.21.3
23+
# env:
24+
# CIBW_ARCHS: aarch64
25+
# CIBW_BUILD: 'cp*-manylinux_aarch64'
26+
# with:
27+
# output-dir: dist
28+
# - uses: actions/upload-artifact@v4
29+
# with:
30+
# name: wheels-manylinux_aarch64
31+
# path: dist/*
4732

4833
wheel-linux-x86_64:
4934
name: Build Linux wheels (x86-64)
50-
runs-on: ubuntu-22.04
51-
strategy:
52-
matrix:
53-
python-tag:
54-
- cp37-manylinux_x86_64
55-
- cp38-manylinux_x86_64
56-
- cp39-manylinux_x86_64
57-
- cp310-manylinux_x86_64
58-
- cp311-manylinux_x86_64
59-
- cp312-manylinux_x86_64
60-
- pp37-manylinux_x86_64
61-
- pp38-manylinux_x86_64
62-
- pp39-manylinux_x86_64
63-
- pp310-manylinux_x86_64
35+
runs-on: ubuntu-latest
6436
steps:
65-
- uses: actions/checkout@v3
66-
- uses: actions-rs/toolchain@v1
67-
with:
68-
toolchain: stable
69-
override: true
37+
- uses: actions/checkout@v4
7038
- name: Build manylinux wheels
71-
uses: pypa/cibuildwheel@v2.16.2
39+
uses: pypa/cibuildwheel@v2.21.3
7240
env:
7341
CIBW_ARCHS: x86_64
74-
CIBW_BUILD: ${{ matrix.python-tag }}
75-
CIBW_BEFORE_ALL: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y"
76-
CIBW_BUILD_VERBOSITY: 2
77-
CIBW_ENVIRONMENT: CARGO_NET_GIT_FETCH_WITH_CLI=true
42+
CIBW_BUILD: 'cp*-manylinux_x86_64'
7843
with:
7944
output-dir: dist
80-
- uses: actions/upload-artifact@v3
45+
- uses: actions/upload-artifact@v4
8146
with:
82-
name: wheels
47+
name: wheels-manylinux_x86_64
8348
path: dist/*
8449

8550
wheel-macos-x86_64:
8651
name: Build MacOS wheels (x86-64)
87-
runs-on: macOS-12
88-
strategy:
89-
matrix:
90-
python-tag:
91-
- cp37-macosx_x86_64
92-
- cp38-macosx_x86_64
93-
- cp39-macosx_x86_64
94-
- cp310-macosx_x86_64
95-
- cp311-macosx_x86_64
96-
- cp312-macosx_x86_64
97-
- pp37-macosx_x86_64
98-
- pp38-macosx_x86_64
99-
- pp39-macosx_x86_64
100-
- pp310-macosx_x86_64
52+
runs-on: macOS-latest
10153
steps:
102-
- uses: actions/checkout@v3
103-
- uses: actions-rs/toolchain@v1
54+
- uses: actions/checkout@v4
55+
- uses: dtolnay/rust-toolchain@stable
10456
with:
105-
toolchain: stable
106-
override: true
57+
targets: x86_64-apple-darwin
10758
- name: Build manylinux wheels
108-
uses: pypa/cibuildwheel@v2.16.2
59+
uses: pypa/cibuildwheel@v2.21.3
10960
env:
11061
CIBW_ARCHS: x86_64
111-
CIBW_BUILD: ${{ matrix.python-tag }}
112-
CIBW_BEFORE_ALL: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y"
113-
CIBW_BUILD_VERBOSITY: 2
114-
CIBW_ENVIRONMENT: CARGO_NET_GIT_FETCH_WITH_CLI=true
62+
CIBW_BUILD: 'cp*-macosx_x86_64'
63+
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=12.0
64+
CIBW_TEST_SKIP: "*"
11565
with:
11666
output-dir: dist
117-
- uses: actions/upload-artifact@v3
67+
- uses: actions/upload-artifact@v4
11868
with:
119-
name: wheels
69+
name: wheels-macosx_x86_64
12070
path: dist/*
12171

12272
wheel-macos-aarch64:
12373
name: Build MacOS wheels (Aarch64)
124-
runs-on: macOS-12
125-
strategy:
126-
matrix:
127-
python-tag:
128-
- cp38-macosx_arm64
129-
- cp39-macosx_arm64
130-
- cp310-macosx_arm64
131-
- cp311-macosx_arm64
132-
- cp312-macosx_arm64
74+
runs-on: macOS-latest
13375
steps:
134-
- uses: actions/checkout@v3
135-
- uses: actions-rs/toolchain@v1
76+
- uses: actions/checkout@v4
77+
- uses: dtolnay/rust-toolchain@stable
13678
with:
137-
toolchain: stable
138-
override: true
139-
target: aarch64-apple-darwin
79+
targets: aarch64-apple-darwin
14080
- name: Build manylinux wheels
141-
uses: pypa/cibuildwheel@v2.16.2
81+
uses: pypa/cibuildwheel@v2.21.3
14282
env:
14383
CIBW_ARCHS: arm64
144-
CIBW_BUILD: ${{ matrix.python-tag }}
145-
CIBW_BEFORE_ALL: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y"
146-
CIBW_BUILD_VERBOSITY: 2
147-
CIBW_ENVIRONMENT: CARGO_NET_GIT_FETCH_WITH_CLI=true
84+
CIBW_BUILD: 'cp*-macosx_arm64'
14885
with:
14986
output-dir: dist
150-
- uses: actions/upload-artifact@v3
87+
- uses: actions/upload-artifact@v4
15188
with:
152-
name: wheels
89+
name: wheels-macosx_arm64
15390
path: dist/*
15491

15592
wheel-win32-x86_64:
15693
name: Build Windows wheels (x86-64)
157-
runs-on: windows-2022
158-
strategy:
159-
matrix:
160-
python-tag:
161-
- cp37-win_amd64
162-
- cp38-win_amd64
163-
- cp39-win_amd64
164-
- cp310-win_amd64
165-
- cp311-win_amd64
166-
- cp312-win_amd64
167-
- pp37-win_amd64
168-
- pp38-win_amd64
169-
- pp39-win_amd64
170-
- pp310-win_amd64
94+
runs-on: windows-latest
17195
steps:
172-
- uses: actions/checkout@v3
173-
- uses: actions-rs/toolchain@v1
174-
with:
175-
toolchain: stable
176-
override: true
96+
- uses: actions/checkout@v4
97+
- uses: dtolnay/rust-toolchain@stable
17798
- name: Build manylinux wheels
178-
uses: pypa/cibuildwheel@v2.16.2
99+
uses: pypa/cibuildwheel@v2.21.3
179100
env:
180101
CIBW_ARCHS: AMD64
181-
CIBW_BUILD: ${{ matrix.python-tag }}
182-
CIBW_BUILD_VERBOSITY: 2
102+
CIBW_BUILD: 'cp*-win_amd64'
183103
with:
184104
output-dir: dist
185-
- uses: actions/upload-artifact@v3
105+
- uses: actions/upload-artifact@v4
186106
with:
187-
name: wheels
107+
name: wheels-win_amd64
108+
path: dist/*
109+
110+
sdist:
111+
runs-on: ubuntu-latest
112+
name: Build source distribution
113+
steps:
114+
- uses: actions/checkout@v4
115+
with:
116+
submodules: true
117+
- name: Set up Python 3.13
118+
uses: actions/setup-python@v5
119+
with:
120+
python-version: 3.13
121+
- name: Install CI requirements
122+
run: python -m pip install -U build maturin
123+
- name: Build source distribution without vendored sources
124+
run: python -m build -s . -n
125+
- uses: actions/upload-artifact@v4
126+
with:
127+
name: sdist
188128
path: dist/*
189129

190130
upload:
@@ -222,13 +162,14 @@ jobs:
222162
release:
223163
environment: GitHub Releases
224164
runs-on: ubuntu-latest
225-
if: "!contains(github.ref, 'rc')"
165+
if: "startsWith(github.ref, 'refs/tags/v')"
226166
name: Release
227167
needs: upload
168+
permissions: write-all
228169
steps:
229170
- name: Checkout code
230-
uses: actions/checkout@v1
171+
uses: actions/checkout@v4
231172
- name: Release a Changelog
232-
uses: rasmus-saks/release-a-changelog-action@v1.0.1
173+
uses: rasmus-saks/release-a-changelog-action@v1.2.0
233174
with:
234175
github-token: '${{ secrets.GITHUB_TOKEN }}'

.github/workflows/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
maturin ~=1.2

0 commit comments

Comments
 (0)