Skip to content

Commit d16e545

Browse files
committed
chore: add armv7l wheels
1 parent a961af7 commit d16e545

File tree

1 file changed

+92
-37
lines changed

1 file changed

+92
-37
lines changed

.github/workflows/ci.yml

+92-37
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
contents: write
8787
outputs:
8888
released: ${{ steps.release.outputs.released }}
89-
newest_release_tag: ${{ steps.release_tag.outputs.newest_release_tag }}
89+
newest_release_tag: ${{ steps.release.outputs.tag }}
9090

9191
steps:
9292
- uses: actions/checkout@v4
@@ -119,73 +119,125 @@ jobs:
119119
with:
120120
github_token: ${{ secrets.GITHUB_TOKEN }}
121121

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-
131122
build_wheels:
132123
needs: [release]
133124
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 }}
136126
runs-on: ${{ matrix.os }}
137127
strategy:
138128
matrix:
139129
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
148142
musl: "musllinux"
149-
- os: macos-latest
143+
- os: ubuntu-24.04-arm
150144
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
152149
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
153189
steps:
154190
- uses: actions/checkout@v4
155191
with:
156-
ref: "v${{ needs.release.outputs.newest_release_tag }}"
192+
ref: ${{ needs.release.outputs.newest_release_tag }}
157193
fetch-depth: 0
158-
159194
# Used to host cibuildwheel
160195
- name: Set up Python
161196
uses: actions/setup-python@v5
162197
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
168223
- 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
171225
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*' }}
175227
REQUIRE_CYTHON: 1
176-
CIBW_ARCHS_LINUX: ${{ matrix.os == 'ubuntu-24.04-arm' && 'aarch64' || 'auto' }}
177228

178229
- uses: actions/upload-artifact@v4
179230
with:
231+
name: wheels-${{ matrix.os }}-${{ matrix.musl }}-${{ matrix.pyver }}-${{ matrix.qemu }}
180232
path: ./wheelhouse/*.whl
181-
name: wheels-${{ matrix.os }}-${{ matrix.musl }}
182233

183234
upload_pypi:
184235
needs: [build_wheels]
185236
runs-on: ubuntu-latest
186237
environment: release
187238
permissions:
188239
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
240+
189241
steps:
190242
- uses: actions/download-artifact@v4
191243
with:
@@ -195,4 +247,7 @@ jobs:
195247
pattern: wheels-*
196248
merge-multiple: true
197249

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

Comments
 (0)