WIP: build aarch64 wheels on release branches

This commit is contained in:
David Robertson 2022-10-03 14:19:51 +01:00
parent 061739d10f
commit f8b9d0b6dd
No known key found for this signature in database
GPG key ID: 903ECE108A39DEDD

View file

@ -94,29 +94,55 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-10.15]
# is_pr is a flag used to exclude certain jobs from the matrix on PRs.
# It is not read by the rest of the workflow.
is_pr:
- ${{ startsWith(github.ref, 'refs/pull/') }}
include:
- os: ubuntu-20.04
emulate_aarch64: false
- os: ubuntu-20.04
emulate_aarch64: true
- os: macos-10.15
emulate_aarch64: false
exclude:
# Don't build macos wheels on PR CI.
- is_pr: true
os: "macos-10.15"
# Don't build ARM linux wheels on PR CI either.
- is_pr: true
emulate_aarch64: true
steps:
- name: Debug
run: echo '${{ toJSON(matrix) }}'
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Set up QEMU to emulate arm64
if: matrix.emulate_aarch64
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.9.0 poetry==1.2.0
# Only build a single wheel in CI.
- name: Set env vars.
- name: "Env: build single wheel for CI"
run: |
echo "CIBW_BUILD="cp37-manylinux_x86_64"" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/pull/')
# Only build a single wheel in CI.
- name: "Env: build aarch64 wheels"
run: |
echo "CIBW_ARCHS_LINUX=aarch64 >> $GITHUB_ENV
if: matrix.emulate_aarch64
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env: