|
| 1 | +name: cibuildwheel |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + auto: |
| 7 | + description: Build wheels for auto archs |
| 8 | + required: true |
| 9 | + type: boolean |
| 10 | + extra: |
| 11 | + description: Build wheels for aarch64 armv7l ppc64le & s390x |
| 12 | + required: true |
| 13 | + type: boolean |
| 14 | + |
| 15 | +jobs: |
| 16 | + build_wheels: |
| 17 | + name: On ${{ matrix.os }}, with ${{ matrix.arch }}, build ${{ matrix.build }} wheels |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + os: [ubuntu-24.04] # renovate: github-runner |
| 23 | + arch: [aarch64, ppc64le, s390x, armv7l, x86_64, i686] |
| 24 | + build: [manylinux, musllinux] |
| 25 | + qemu_arch: [aarch64 ppc64le s390x armv7l] |
| 26 | + include: |
| 27 | + - {os: windows-2019, arch: AMD64, build: win} |
| 28 | + - {os: windows-2019, arch: x86, build: win} |
| 29 | + - {os: windows-2022, arch: ARM64, build: win} |
| 30 | + - {os: macos-13, arch: x86_64, build: macos} |
| 31 | + - {os: macos-14, arch: arm64, build: macos} |
| 32 | + |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
| 35 | + if: > |
| 36 | + inputs.auto && !contains(matrix.qemu_arch, matrix.arch) || |
| 37 | + inputs.extra && contains(matrix.qemu_arch, matrix.arch) |
| 38 | + with: |
| 39 | + fetch-depth: 0 |
| 40 | + |
| 41 | + - name: Set up msvc on Windows |
| 42 | + if: runner.os == 'Windows' && inputs.auto && !contains(matrix.qemu_arch, matrix.arch) |
| 43 | + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1 |
| 44 | + with: |
| 45 | + arch: ${{ matrix.arch }} |
| 46 | + |
| 47 | + - name: Set up QEMU |
| 48 | + uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0 |
| 49 | + if: runner.os == 'Linux' && inputs.extra && contains(matrix.qemu_arch, matrix.arch) |
| 50 | + |
| 51 | + - name: Build wheels |
| 52 | + if: > |
| 53 | + inputs.auto && !contains(matrix.qemu_arch, matrix.arch) || |
| 54 | + inputs.extra && contains(matrix.qemu_arch, matrix.arch) |
| 55 | + uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0 |
| 56 | + env: |
| 57 | + CIBW_ARCHS: ${{ matrix.arch }} |
| 58 | + CIBW_BUILD: cp39-${{ matrix.build }}* |
| 59 | + |
| 60 | + - name: Upload wheels |
| 61 | + if: > |
| 62 | + inputs.auto && !contains(matrix.qemu_arch, matrix.arch) || |
| 63 | + inputs.extra && contains(matrix.qemu_arch, matrix.arch) |
| 64 | + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 |
| 65 | + with: |
| 66 | + name: cibw-${{ matrix.os }}-${{ matrix.build }}-${{ matrix.arch }} |
| 67 | + path: wheelhouse/*.whl |
0 commit comments