diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index d9309f5..749a24e 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -30,8 +30,20 @@ jobs: with: path: dist/*.tar.gz + choose_architectures: + name: Decide which architectures to build wheels for + runs-on: ubuntu-latest + steps: + - id: x86_64 + run: echo "cibw_arch=x86_64" >> $GITHUB_OUTPUT + - id: aarch64 + if: github.event_name == 'release' && github.event.action == 'published' + run: echo "cibw_arch=aarch64" >> $GITHUB_OUTPUT + outputs: + cibw_arches: ${{ toJSON(steps.*.outputs.cibw_arch) }} + build_wheels: - needs: [build_sdist] + needs: [build_sdist, choose_architectures] name: Wheel for Linux-${{ matrix.cibw_python }}-${{ matrix.cibw_arch }} runs-on: ${{ matrix.os }} strategy: @@ -39,7 +51,7 @@ jobs: matrix: os: [ubuntu-latest] cibw_python: ["cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"] - cibw_arch: ["x86_64", "aarch64"] + cibw_arch: ${{ fromJSON(needs.choose_architectures.outputs.cibw_arches) }} steps: - name: Disable ptrace security restrictions