diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 0708d631cd..70b22c1fcb 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -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: