Skip to content

Commit d8e3e84

Browse files
authored
Merge pull request #133 from finnagin/arm64-wheel-build
Add windows arm64 wheel build
2 parents f4070f9 + e4f09f1 commit d8e3e84

File tree

1 file changed

+61
-8
lines changed

1 file changed

+61
-8
lines changed

.github/workflows/CI.yml

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
pypy3.11
100100
allow-prereleases: true
101101
- name: Build wheels
102-
uses: PyO3/maturin-action@v1
102+
uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
103103
with:
104104
target: ${{ matrix.target }}
105105
args: --release --out dist --interpreter '3.9 3.10 3.11 3.12 3.13 3.13t pypy3.9 pypy3.10 pypy3.11'
@@ -141,7 +141,7 @@ jobs:
141141
pypy3.11
142142
allow-prereleases: true
143143
- name: Build wheels
144-
uses: PyO3/maturin-action@v1
144+
uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
145145
with:
146146
target: ${{ matrix.target }}
147147
args: --release --out dist --interpreter '3.9 3.10 3.11 3.12 3.13 3.13t pypy3.9 pypy3.10 pypy3.11'
@@ -179,7 +179,7 @@ jobs:
179179
allow-prereleases: true
180180
architecture: ${{ matrix.target }}
181181
- name: Build wheels
182-
uses: PyO3/maturin-action@v1
182+
uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
183183
with:
184184
target: ${{ matrix.target }}
185185
args: --release --out dist --interpreter '3.9 3.10 3.11 3.12 3.13' --interpreter ${{ matrix.target == 'x64' && 'pypy3.9 pypy3.10' || '' }}
@@ -190,6 +190,58 @@ jobs:
190190
name: dist-${{ github.job }}-${{ matrix.target }}
191191
path: dist
192192

193+
windows-arm:
194+
needs: test
195+
runs-on: windows-11-arm
196+
197+
strategy:
198+
fail-fast: false
199+
matrix:
200+
target:
201+
- aarch64-pc-windows-msvc
202+
203+
steps:
204+
- uses: actions/checkout@v4
205+
with:
206+
persist-credentials: false
207+
# Install each python version seperatly so that the paths can be passed to maturin. (otherwise finds pre-installed x64 versions)
208+
- uses: actions/setup-python@v5
209+
id: cp311
210+
with:
211+
python-version: 3.11
212+
allow-prereleases: true
213+
architecture: arm64
214+
- uses: actions/setup-python@v5
215+
id: cp312
216+
with:
217+
python-version: 3.12
218+
allow-prereleases: true
219+
architecture: arm64
220+
- uses: actions/setup-python@v5
221+
id: cp313
222+
with:
223+
python-version: 3.13
224+
allow-prereleases: true
225+
architecture: arm64
226+
# rust toolchain is not currently installed on windopws arm64 images: https://github.com/actions/partner-runner-images/issues/77
227+
- name: Setup rust
228+
id: setup-rust
229+
run: |
230+
Invoke-WebRequest https://static.rust-lang.org/rustup/dist/aarch64-pc-windows-msvc/rustup-init.exe -OutFile .\rustup-init.exe
231+
.\rustup-init.exe -y
232+
Add-Content $env:GITHUB_PATH "$env:USERPROFILE\.cargo\bin"
233+
- name: Build wheels
234+
uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
235+
with:
236+
target: ${{ matrix.target }}
237+
args: --release --out dist --interpreter ${{ steps.cp311.outputs.python-path }} ${{ steps.cp312.outputs.python-path }} ${{ steps.cp313.outputs.python-path }}
238+
sccache: ${{ github.ref_type != 'tag' }} # zizmor: ignore[cache-poisoning]
239+
- name: Upload wheels
240+
uses: actions/upload-artifact@v4
241+
with:
242+
name: dist-${{ github.job }}-${{ matrix.target }}
243+
path: dist
244+
193245
# free-threaded and normal builds share a site-packages folder on Windows so
194246
# we must build free-threaded separately
195247
windows-free-threaded:
@@ -211,7 +263,7 @@ jobs:
211263
allow-prereleases: true
212264
architecture: ${{ matrix.target }}
213265
- name: Build wheels
214-
uses: PyO3/maturin-action@v1
266+
uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
215267
with:
216268
target: ${{ matrix.target }}
217269
args: --release --out dist --interpreter '3.13t'
@@ -249,7 +301,7 @@ jobs:
249301
pypy3.11
250302
allow-prereleases: true
251303
- name: Build wheels
252-
uses: PyO3/maturin-action@v1
304+
uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
253305
with:
254306
target: ${{ matrix.target }}
255307
args: --release --out dist --interpreter '3.9 3.10 3.11 3.12 3.13 3.13t pypy3.9 pypy3.10 pypy3.11'
@@ -271,7 +323,7 @@ jobs:
271323
with:
272324
python-version: 3.13
273325
- name: Build an sdist
274-
uses: PyO3/maturin-action@v1
326+
uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
275327
with:
276328
command: sdist
277329
args: --out dist
@@ -282,7 +334,8 @@ jobs:
282334
path: dist
283335

284336
release:
285-
needs: [manylinux, musllinux, windows, windows-free-threaded, macos]
337+
needs:
338+
[manylinux, musllinux, windows, windows-arm, windows-free-threaded, macos]
286339
runs-on: ubuntu-latest
287340
if: "startsWith(github.ref, 'refs/tags/')"
288341
environment:
@@ -298,7 +351,7 @@ jobs:
298351
pattern: dist-*
299352
merge-multiple: true
300353
- name: Publish to PyPI
301-
uses: PyO3/maturin-action@v1
354+
uses: PyO3/maturin-action@aef21716ff3dcae8a1c301d23ec3e4446972a6e3 # v1.49.1
302355
with:
303356
command: upload
304357
args: --non-interactive --skip-existing *

0 commit comments

Comments
 (0)