Skip to content

Commit e394707

Browse files
authored
feat: add armv7l to wheel builds (#162)
chore: add armv7l to wheel builds
1 parent 9def2bd commit e394707

File tree

1 file changed

+70
-25
lines changed

1 file changed

+70
-25
lines changed

.github/workflows/ci.yml

+70-25
Original file line numberDiff line numberDiff line change
@@ -139,53 +139,98 @@ jobs:
139139
build_wheels:
140140
needs: [release]
141141
if: needs.release.outputs.released == 'true'
142-
143-
name: Build wheels on ${{ matrix.os }}
142+
name: Wheels for ${{ matrix.os }} (${{ matrix.musl == 'musllinux' && 'musllinux' || 'manylinux' }}) ${{ matrix.qemu }} ${{ matrix.pyver }}
144143
runs-on: ${{ matrix.os }}
145144
strategy:
146145
matrix:
147146
os:
148-
- ubuntu-24.04-arm
149-
- macos-latest
150-
- ubuntu-latest
151-
- windows-latest
152-
musl: ["", "musllinux"]
153-
exclude:
154-
- os: windows-latest
147+
[
148+
windows-latest,
149+
ubuntu-24.04-arm,
150+
ubuntu-latest,
151+
macos-13,
152+
macos-latest,
153+
]
154+
qemu: [""]
155+
musl: [""]
156+
pyver: [""]
157+
include:
158+
- os: ubuntu-latest
155159
musl: "musllinux"
156-
- os: macos-latest
160+
- os: ubuntu-24.04-arm
157161
musl: "musllinux"
158-
162+
# qemu is slow, make a single
163+
# runner per Python version
164+
- os: ubuntu-latest
165+
qemu: armv7l
166+
musl: "musllinux"
167+
pyver: cp311
168+
- os: ubuntu-latest
169+
qemu: armv7l
170+
musl: "musllinux"
171+
pyver: cp312
172+
- os: ubuntu-latest
173+
qemu: armv7l
174+
musl: "musllinux"
175+
pyver: cp313
176+
# qemu is slow, make a single
177+
# runner per Python version
178+
- os: ubuntu-latest
179+
qemu: armv7l
180+
musl: ""
181+
pyver: cp311
182+
- os: ubuntu-latest
183+
qemu: armv7l
184+
musl: ""
185+
pyver: cp312
186+
- os: ubuntu-latest
187+
qemu: armv7l
188+
musl: ""
189+
pyver: cp313
159190
steps:
160191
- uses: actions/checkout@v4
161192
with:
162193
ref: ${{ needs.release.outputs.newest_release_tag }}
163194
fetch-depth: 0
164-
165195
# Used to host cibuildwheel
166196
- name: Set up Python
167197
uses: actions/setup-python@v5
168198
with:
169-
python-version: "3.11"
170-
171-
- name: Install cibuildwheel
172-
run: python -m pip install cibuildwheel==2.22.0
173-
199+
python-version: "3.12"
200+
- name: Set up QEMU
201+
if: ${{ matrix.qemu }}
202+
uses: docker/setup-qemu-action@v3
203+
with:
204+
platforms: all
205+
# This should be temporary
206+
# xref https://github.com/docker/setup-qemu-action/issues/188
207+
# xref https://github.com/tonistiigi/binfmt/issues/215
208+
image: tonistiigi/binfmt:qemu-v8.1.5
209+
id: qemu
210+
- name: Prepare emulation
211+
if: ${{ matrix.qemu }}
212+
run: |
213+
if [[ -n "${{ matrix.qemu }}" ]]; then
214+
# Build emulated architectures only if QEMU is set,
215+
# use default "auto" otherwise
216+
echo "CIBW_ARCHS_LINUX=${{ matrix.qemu }}" >> $GITHUB_ENV
217+
fi
218+
- name: Limit to a specific Python version on slow QEMU
219+
if: ${{ matrix.pyver }}
220+
run: |
221+
if [[ -n "${{ matrix.pyver }}" ]]; then
222+
echo "CIBW_BUILD=${{ matrix.pyver }}*" >> $GITHUB_ENV
223+
fi
174224
- name: Build wheels
175-
run: python -m cibuildwheel --output-dir wheelhouse
176-
# to supply options, put them in 'env', like:
225+
uses: pypa/cibuildwheel@v2.23.0
177226
env:
178-
CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* cp310-* pp36-* pp37-* pp38-* pp39-* pp310-* ${{ matrix.musl == 'musllinux' && '*manylinux*' || '*musllinux*' }}
179-
CIBW_BEFORE_ALL_LINUX: apt-get install -y gcc || yum install -y gcc || apk add gcc
180-
CIBW_BUILD_VERBOSITY: 3
227+
CIBW_SKIP: cp36-* cp37-* cp38-* cp39-* cp310-* pp* ${{ matrix.musl == 'musllinux' && '*manylinux*' || '*musllinux*' }}
181228
REQUIRE_CYTHON: 1
182-
CIBW_ARCHS_LINUX: ${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64' || 'auto' }}
183229

184230
- uses: actions/upload-artifact@v4
185231
with:
232+
name: wheels-${{ matrix.os }}-${{ matrix.musl }}-${{ matrix.pyver }}-${{ matrix.qemu }}
186233
path: ./wheelhouse/*.whl
187-
name: wheels-${{ matrix.os }}-${{ matrix.musl }}
188-
189234
upload_pypi:
190235
needs: [build_wheels]
191236
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)