86
86
contents : write
87
87
outputs :
88
88
released : ${{ steps.release.outputs.released }}
89
- newest_release_tag : ${{ steps.release_tag .outputs.newest_release_tag }}
89
+ newest_release_tag : ${{ steps.release .outputs.tag }}
90
90
91
91
steps :
92
92
- uses : actions/checkout@v4
@@ -119,73 +119,125 @@ jobs:
119
119
with :
120
120
github_token : ${{ secrets.GITHUB_TOKEN }}
121
121
122
- - name : Install python-semantic-release
123
- run : python3 -m pip install python-semantic-release==7.34.6
124
-
125
- - name : Get Release Tag
126
- id : release_tag
127
- shell : bash
128
- run : |
129
- echo "newest_release_tag=$(semantic-release print-version --current)" >> $GITHUB_OUTPUT
130
-
131
122
build_wheels :
132
123
needs : [release]
133
124
if : needs.release.outputs.released == 'true'
134
-
135
- name : Build wheels on ${{ matrix.os }}
125
+ name : Wheels for ${{ matrix.os }} (${{ matrix.musl == 'musllinux' && 'musllinux' || 'manylinux' }}) ${{ matrix.qemu }} ${{ matrix.pyver }}
136
126
runs-on : ${{ matrix.os }}
137
127
strategy :
138
128
matrix :
139
129
os :
140
- - ubuntu-24.04-arm
141
- - macos-13
142
- - macos-latest
143
- - ubuntu-latest
144
- - windows-latest
145
- musl : ["", "musllinux"]
146
- exclude :
147
- - os : windows-latest
130
+ [
131
+ windows-latest,
132
+ ubuntu-24.04-arm,
133
+ ubuntu-latest,
134
+ macos-13,
135
+ macos-latest,
136
+ ]
137
+ qemu : [""]
138
+ musl : [""]
139
+ pyver : [""]
140
+ include :
141
+ - os : ubuntu-latest
148
142
musl : " musllinux"
149
- - os : macos-latest
143
+ - os : ubuntu-24.04-arm
150
144
musl : " musllinux"
151
- - os : macos-13
145
+ # qemu is slow, make a single
146
+ # runner per Python version
147
+ - os : ubuntu-latest
148
+ qemu : armv7l
152
149
musl : " musllinux"
150
+ pyver : cp39
151
+ - os : ubuntu-latest
152
+ qemu : armv7l
153
+ musl : " musllinux"
154
+ pyver : cp310
155
+ - os : ubuntu-latest
156
+ qemu : armv7l
157
+ musl : " musllinux"
158
+ pyver : cp311
159
+ - os : ubuntu-latest
160
+ qemu : armv7l
161
+ musl : " musllinux"
162
+ pyver : cp312
163
+ - os : ubuntu-latest
164
+ qemu : armv7l
165
+ musl : " musllinux"
166
+ pyver : cp313
167
+ # qemu is slow, make a single
168
+ # runner per Python version
169
+ - os : ubuntu-latest
170
+ qemu : armv7l
171
+ musl : " "
172
+ pyver : cp39
173
+ - os : ubuntu-latest
174
+ qemu : armv7l
175
+ musl : " "
176
+ pyver : cp310
177
+ - os : ubuntu-latest
178
+ qemu : armv7l
179
+ musl : " "
180
+ pyver : cp311
181
+ - os : ubuntu-latest
182
+ qemu : armv7l
183
+ musl : " "
184
+ pyver : cp312
185
+ - os : ubuntu-latest
186
+ qemu : armv7l
187
+ musl : " "
188
+ pyver : cp313
153
189
steps :
154
190
- uses : actions/checkout@v4
155
191
with :
156
- ref : " v ${{ needs.release.outputs.newest_release_tag }}"
192
+ ref : ${{ needs.release.outputs.newest_release_tag }}
157
193
fetch-depth : 0
158
-
159
194
# Used to host cibuildwheel
160
195
- name : Set up Python
161
196
uses : actions/setup-python@v5
162
197
with :
163
- python-version : " 3.11"
164
-
165
- - name : Install cibuildwheel
166
- run : python -m pip install cibuildwheel==2.22.0
167
-
198
+ python-version : " 3.12"
199
+ - name : Set up QEMU
200
+ if : ${{ matrix.qemu }}
201
+ uses : docker/setup-qemu-action@v3
202
+ with :
203
+ platforms : all
204
+ # This should be temporary
205
+ # xref https://github.com/docker/setup-qemu-action/issues/188
206
+ # xref https://github.com/tonistiigi/binfmt/issues/215
207
+ image : tonistiigi/binfmt:qemu-v8.1.5
208
+ id : qemu
209
+ - name : Prepare emulation
210
+ if : ${{ matrix.qemu }}
211
+ run : |
212
+ if [[ -n "${{ matrix.qemu }}" ]]; then
213
+ # Build emulated architectures only if QEMU is set,
214
+ # use default "auto" otherwise
215
+ echo "CIBW_ARCHS_LINUX=${{ matrix.qemu }}" >> $GITHUB_ENV
216
+ fi
217
+ - name : Limit to a specific Python version on slow QEMU
218
+ if : ${{ matrix.pyver }}
219
+ run : |
220
+ if [[ -n "${{ matrix.pyver }}" ]]; then
221
+ echo "CIBW_BUILD=${{ matrix.pyver }}*" >> $GITHUB_ENV
222
+ fi
168
223
- name : Build wheels
169
- run : python -m cibuildwheel --output-dir wheelhouse
170
- # to supply options, put them in 'env', like:
224
+ uses : pypa/cibuildwheel@v2.23.0
171
225
env :
172
- CIBW_SKIP : cp36-* cp37-* cp38-* pp36-* pp37-* pp38-* ${{ matrix.musl == 'musllinux' && '*manylinux*' || '*musllinux*' }}
173
- CIBW_BEFORE_ALL_LINUX : apt-get install -y gcc || yum install -y gcc || apk add gcc
174
- CIBW_BUILD_VERBOSITY : 3
226
+ CIBW_SKIP : cp36-* cp37-* cp38-* pp* ${{ matrix.musl == 'musllinux' && '*manylinux*' || '*musllinux*' }}
175
227
REQUIRE_CYTHON : 1
176
- CIBW_ARCHS_LINUX : ${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64' || 'auto' }}
177
228
178
229
- uses : actions/upload-artifact@v4
179
230
with :
231
+ name : wheels-${{ matrix.os }}-${{ matrix.musl }}-${{ matrix.pyver }}-${{ matrix.qemu }}
180
232
path : ./wheelhouse/*.whl
181
- name : wheels-${{ matrix.os }}-${{ matrix.musl }}
182
233
183
234
upload_pypi :
184
235
needs : [build_wheels]
185
236
runs-on : ubuntu-latest
186
237
environment : release
187
238
permissions :
188
239
id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
240
+
189
241
steps :
190
242
- uses : actions/download-artifact@v4
191
243
with :
@@ -195,4 +247,7 @@ jobs:
195
247
pattern : wheels-*
196
248
merge-multiple : true
197
249
198
- - uses : pypa/gh-action-pypi-publish@v1.12.4
250
+ - uses :
251
+ pypa/gh-action-pypi-publish@v1.12.4
252
+
253
+ # To test: repository_url: https://test.pypi.org/legacy/
0 commit comments