@@ -163,54 +163,98 @@ jobs:
163163 build_wheels :
164164 needs : [release]
165165 if : needs.release.outputs.released == 'true'
166-
167- name : Build wheels on ${{ matrix.os }}
166+ name : Wheels for ${{ matrix.os }} (${{ matrix.musl == 'musllinux' && 'musllinux' || 'manylinux' }}) ${{ matrix.qemu }} ${{ matrix.pyver }}
168167 runs-on : ${{ matrix.os }}
169168 strategy :
170169 matrix :
171170 os :
172- - ubuntu-24.04-arm
173- - macos-13
174- - macos-latest
175- - ubuntu-latest
176- - windows-latest
177- musl : ["", "musllinux"]
178- exclude :
179- - os : windows-latest
171+ [
172+ windows-latest,
173+ ubuntu-24.04-arm,
174+ ubuntu-latest,
175+ macos-13,
176+ macos-latest,
177+ ]
178+ qemu : [""]
179+ musl : [""]
180+ pyver : [""]
181+ include :
182+ - os : ubuntu-latest
183+ musl : " musllinux"
184+ - os : ubuntu-24.04-arm
180185 musl : " musllinux"
181- - os : macos-latest
186+ # qemu is slow, make a single
187+ # runner per Python version
188+ - os : ubuntu-latest
189+ qemu : armv7l
182190 musl : " musllinux"
183- - os : macos-13
191+ pyver : cp311
192+ - os : ubuntu-latest
193+ qemu : armv7l
184194 musl : " musllinux"
195+ pyver : cp312
196+ - os : ubuntu-latest
197+ qemu : armv7l
198+ musl : " musllinux"
199+ pyver : cp313
200+ # qemu is slow, make a single
201+ # runner per Python version
202+ - os : ubuntu-latest
203+ qemu : armv7l
204+ musl : " "
205+ pyver : cp311
206+ - os : ubuntu-latest
207+ qemu : armv7l
208+ musl : " "
209+ pyver : cp312
210+ - os : ubuntu-latest
211+ qemu : armv7l
212+ musl : " "
213+ pyver : cp313
185214 steps :
186215 - uses : actions/checkout@v4
187216 with :
188217 ref : ${{ needs.release.outputs.newest_release_tag }}
189218 fetch-depth : 0
190-
191219 # Used to host cibuildwheel
192220 - name : Set up Python
193221 uses : actions/setup-python@v5
194222 with :
195- python-version : " 3.11"
196-
197- - name : Install cibuildwheel
198- run : python -m pip install cibuildwheel==2.23.0
199-
223+ python-version : " 3.12"
224+ - name : Set up QEMU
225+ if : ${{ matrix.qemu }}
226+ uses : docker/setup-qemu-action@v3
227+ with :
228+ platforms : all
229+ # This should be temporary
230+ # xref https://github.com/docker/setup-qemu-action/issues/188
231+ # xref https://github.com/tonistiigi/binfmt/issues/215
232+ image : tonistiigi/binfmt:qemu-v8.1.5
233+ id : qemu
234+ - name : Prepare emulation
235+ if : ${{ matrix.qemu }}
236+ run : |
237+ if [[ -n "${{ matrix.qemu }}" ]]; then
238+ # Build emulated architectures only if QEMU is set,
239+ # use default "auto" otherwise
240+ echo "CIBW_ARCHS_LINUX=${{ matrix.qemu }}" >> $GITHUB_ENV
241+ fi
242+ - name : Limit to a specific Python version on slow QEMU
243+ if : ${{ matrix.pyver }}
244+ run : |
245+ if [[ -n "${{ matrix.pyver }}" ]]; then
246+ echo "CIBW_BUILD=${{ matrix.pyver }}*" >> $GITHUB_ENV
247+ fi
200248 - name : Build wheels
201- run : python -m cibuildwheel --output-dir wheelhouse
202- # to supply options, put them in 'env', like:
249+ 203250 env :
204- CIBW_SKIP : cp36-* cp37-* cp38-* cp39-* cp310-* pp36-* pp37-* pp38-* pp39-* pp310-* ${{ matrix.musl == 'musllinux' && '*manylinux*' || '*musllinux*' }}
205- CIBW_BEFORE_ALL_LINUX : apt-get install -y gcc || yum install -y gcc || apk add gcc
206- CIBW_BUILD_VERBOSITY : 3
251+ CIBW_SKIP : cp36-* cp37-* cp38-* cp39-* cp310-* pp* ${{ matrix.musl == 'musllinux' && '*manylinux*' || '*musllinux*' }}
207252 REQUIRE_CYTHON : 1
208- CIBW_ARCHS_LINUX : ${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64' || 'auto' }}
209253
210254 - uses : actions/upload-artifact@v4
211255 with :
256+ name : wheels-${{ matrix.os }}-${{ matrix.musl }}-${{ matrix.pyver }}-${{ matrix.qemu }}
212257 path : ./wheelhouse/*.whl
213- name : wheels-${{ matrix.os }}-${{ matrix.musl }}
214258
215259 upload_pypi :
216260 needs : [build_wheels]
0 commit comments