@@ -139,53 +139,98 @@ jobs:
139
139
build_wheels :
140
140
needs : [release]
141
141
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 }}
144
143
runs-on : ${{ matrix.os }}
145
144
strategy :
146
145
matrix :
147
146
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
155
159
musl : " musllinux"
156
- - os : macos-latest
160
+ - os : ubuntu-24.04-arm
157
161
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
159
190
steps :
160
191
- uses : actions/checkout@v4
161
192
with :
162
193
ref : ${{ needs.release.outputs.newest_release_tag }}
163
194
fetch-depth : 0
164
-
165
195
# Used to host cibuildwheel
166
196
- name : Set up Python
167
197
uses : actions/setup-python@v5
168
198
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
174
224
- 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
177
226
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*' }}
181
228
REQUIRE_CYTHON : 1
182
- CIBW_ARCHS_LINUX : ${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64' || 'auto' }}
183
229
184
230
- uses : actions/upload-artifact@v4
185
231
with :
232
+ name : wheels-${{ matrix.os }}-${{ matrix.musl }}-${{ matrix.pyver }}-${{ matrix.qemu }}
186
233
path : ./wheelhouse/*.whl
187
- name : wheels-${{ matrix.os }}-${{ matrix.musl }}
188
-
189
234
upload_pypi :
190
235
needs : [build_wheels]
191
236
runs-on : ubuntu-latest
0 commit comments