-
Notifications
You must be signed in to change notification settings - Fork 21
73 lines (70 loc) · 2.6 KB
/
run-cibuildwheel.yml
File metadata and controls
73 lines (70 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# borrowing from pycares again due to the complexity of building wheels being rather annoying.
on:
workflow_call:
inputs:
fail-fast:
description: Whether the wheel build should stop and fail as soon as any job fails.
required: false
default: false
type: boolean
prerelease-pythons:
description: Whether the wheels should be built for pre-release Pythons that are not ABI stable yet.
required: false
default: false
type: boolean
jobs:
generate-wheels-matrix:
# Create a matrix of all architectures & versions to build.
# This enables the next step to run cibuildwheel in parallel.
# From https://iscinumpy.dev/post/cibuildwheel-2-10-0/#only-210
name: Generate wheels matrix
runs-on: ubuntu-latest
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v6
- name: Install cibuildwheel
# Nb. keep cibuildwheel version pin consistent with job below
run: pipx install cibuildwheel==3.2.1
- id: set-matrix
# Trimmed out setupmatrix for just windows but I might look at compiling other oses just for fun
# to let others test what it would be like if uvloop supported windows. It's very tempting...
run: |
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform windows --archs AMD64 \
| jq -nRc '{"only": inputs, "os": "windows-latest"}' \
&& cibuildwheel --print-build-identifiers --platform windows --archs ARM64 \
| jq -nRc '{"only": inputs, "os": "windows-11-arm"}'
} | jq -sc
)
echo "include=$MATRIX" >> $GITHUB_OUTPUT
build_wheels:
name: Build wheels for ${{ matrix.only }}
runs-on: ${{ matrix.os }}
needs: generate-wheels-matrix
strategy:
fail-fast: ${{ inputs.fail-fast }}
matrix:
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }}
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v4
with:
platforms: all
- name: Enable CPython prerelease
if: ${{ inputs.prerelease-pythons }}
run: echo "CIBW_ENABLE=cpython-prerelease" >> $GITHUB_ENV
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.1
with:
only: ${{ matrix.only }}
output-dir: dist
- uses: actions/upload-artifact@v7
with:
name: wheels-${{ matrix.only }}
path: dist/*.whl