Update cibuildwheel.yml #220
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cibuildwheel | |
# Note: We use a dynamic matrix to build different sets of wheels under | |
# different conditions. On workflow_dispatch, we build the full suite of | |
# wheels. This takes hours, so on pull_request, we just build a representative | |
# sample. | |
# The full list of cibuildwheel's build targets can be found here: | |
# https://github.com/pypa/cibuildwheel/blob/v2.22.0/cibuildwheel/resources/build-platforms.toml | |
# Notes on build targets we (don't) support: | |
# - pypy: libtorrent doesn't build with pypy as of writing | |
# - macos_arm64: can be cross-compiled from x86_64, but not run, so can't be | |
# tested. Build output indicates it isn't building correctly | |
# - macos_universal2: b2 / setup.py doesn't have a straightforward way to build | |
# this as of writing | |
# - abi3: Not supported by boost-python (or pybind11) or cibuildwheel as of | |
# writing | |
on: | |
workflow_dispatch: | |
inputs: | |
publish: | |
description: Write 'PUBLISH' to publish to pypi. BEWARE! ARTIFACTS ARE IMMUTABLE AND CANNOT BE REPLACED ONCE PUBLISHED! | |
publish_test: | |
description: Write 'PUBLISH_TEST' to publish to test-pypi. BEWARE! ARTIFACTS ARE IMMUTABLE AND CANNOT BE REPLACED ONCE PUBLISHED! | |
pull_request: | |
paths: | |
- .github/workflows/cibuildwheel.yml | |
- tools/cibuildwheel/** | |
- pyproject.toml | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} | |
cancel-in-progress: true | |
jobs: | |
configure_matrix: | |
runs-on: ubuntu-latest | |
env: | |
# github actions syntax doesn't allow us to have yaml structures as | |
# an input to a job. These environment variables are literal json strings | |
MATRIX_PULL_REQUEST: | | |
{ | |
"include": [ | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-manylinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp310-manylinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp311-manylinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp312-manylinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp313-manylinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-manylinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp310-manylinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp311-manylinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp312-manylinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp313-manylinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-musllinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp310-musllinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp311-musllinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp312-musllinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp313-musllinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp39-musllinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp310-musllinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp311-musllinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp312-musllinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp313-musllinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "macos-12", "CIBW_BUILD": "cp39-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "12"}, | |
{"os": "macos-12", "CIBW_BUILD": "cp310-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "12"}, | |
{"os": "macos-12", "CIBW_BUILD": "cp311-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "12"}, | |
{"os": "macos-12", "CIBW_BUILD": "cp312-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "12"}, | |
{"os": "macos-12", "CIBW_BUILD": "cp313-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "12"}, | |
{"os": "macos-13", "CIBW_BUILD": "cp39-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "13"}, | |
{"os": "macos-13", "CIBW_BUILD": "cp310-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "13"}, | |
{"os": "macos-13", "CIBW_BUILD": "cp311-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "13"}, | |
{"os": "macos-13", "CIBW_BUILD": "cp312-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "13"}, | |
{"os": "macos-13", "CIBW_BUILD": "cp313-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "13"}, | |
{"os": "macos-14", "CIBW_BUILD": "cp39-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "14"}, | |
{"os": "macos-14", "CIBW_BUILD": "cp310-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "14"}, | |
{"os": "macos-14", "CIBW_BUILD": "cp311-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "14"}, | |
{"os": "macos-14", "CIBW_BUILD": "cp312-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "14"}, | |
{"os": "macos-14", "CIBW_BUILD": "cp313-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "14"}, | |
{"os": "macos-15", "CIBW_BUILD": "cp39-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "15"}, | |
{"os": "macos-15", "CIBW_BUILD": "cp310-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "15"}, | |
{"os": "macos-15", "CIBW_BUILD": "cp311-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "15"}, | |
{"os": "macos-15", "CIBW_BUILD": "cp312-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "15"}, | |
{"os": "macos-15", "CIBW_BUILD": "cp313-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "15"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp39-win32", "CIBW_ARCHS_WINDOWS": "x86"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp310-win32", "CIBW_ARCHS_WINDOWS": "x86"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp311-win32", "CIBW_ARCHS_WINDOWS": "x86"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp312-win32", "CIBW_ARCHS_WINDOWS": "x86"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp313-win32", "CIBW_ARCHS_WINDOWS": "x86"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp39-win_amd64", "CIBW_ARCHS_WINDOWS": "AMD64"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp310-win_amd64", "CIBW_ARCHS_WINDOWS": "AMD64"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp311-win_amd64", "CIBW_ARCHS_WINDOWS": "AMD64"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp312-win_amd64", "CIBW_ARCHS_WINDOWS": "AMD64"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp313-win_amd64", "CIBW_ARCHS_WINDOWS": "AMD64"} | |
] | |
} | |
MATRIX_WORKFLOW_DISPATCH: | | |
{ | |
"include": [ | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-manylinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_x86_64", "CIBW_ARCHS_LINUX": "x86_64"}, | |
{"os": "ubuntu-latest", "CIBW_BUILD": "cp*-musllinux_aarch64", "CIBW_ARCHS_LINUX": "aarch64"}, | |
{"os": "macos-12", "CIBW_BUILD": "cp*-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "12"}, | |
{"os": "macos-13", "CIBW_BUILD": "cp*-macosx_x86_64", "CIBW_ARCHS_MACOS": "x86_64", "MACOSX_DEPLOYMENT_TARGET": "13"}, | |
{"os": "macos-14", "CIBW_BUILD": "cp*-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "14"}, | |
{"os": "macos-15", "CIBW_BUILD": "cp*-macosx_arm64", "CIBW_ARCHS_MACOS": "arm64", "MACOSX_DEPLOYMENT_TARGET": "15"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp*-win32", "CIBW_ARCHS_WINDOWS": "x86"}, | |
{"os": "windows-latest", "CIBW_BUILD": "cp*-win_amd64", "CIBW_ARCHS_WINDOWS": "AMD64"} | |
] | |
} | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- id: set-matrix | |
run: | | |
if [ $GITHUB_EVENT_NAME == "pull_request" ]; then | |
echo "matrix=$(echo $MATRIX_PULL_REQUEST | jq -c)" >> "$GITHUB_OUTPUT" | |
else | |
echo "matrix=$(echo $MATRIX_WORKFLOW_DISPATCH | jq -c)" >> "$GITHUB_OUTPUT" | |
fi | |
build_wheels: | |
needs: configure_matrix | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.configure_matrix.outputs.matrix) }} | |
env: | |
CIBW_BUILD_VERBOSITY: 1 | |
CIBW_BUILD: ${{ matrix.CIBW_BUILD }} | |
CIBW_ARCHS_LINUX: ${{ matrix.CIBW_ARCHS_LINUX }} | |
CIBW_ARCHS_WINDOWS: ${{ matrix.CIBW_ARCHS_WINDOWS }} | |
CIBW_ARCHS_MACOS: ${{ matrix.CIBW_ARCHS_MACOS }} | |
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.MACOSX_DEPLOYMENT_TARGET }} | |
CIBW_SKIP: pp* | |
CIBW_TEST_SKIP: "*-win32" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 1 | |
filter: tree:0 | |
- uses: actions/cache@v4 | |
id: cache-wheel | |
with: | |
path: wheelhouse | |
key: wheel-${{ matrix.os }}-${{ matrix.CIBW_BUILD }} | |
- uses: docker/setup-qemu-action@v3 | |
if: steps.cache-wheel.outputs.cache-hit != 'true' && runner.os == 'Linux' | |
- name: Install OpenSSL (win32) | |
if: ${{ endsWith(matrix.CIBW_BUILD, 'win32') }} | |
run: | | |
Remove-Item -Path "C:\Program Files\OpenSSL" -Force -Recurse | |
vcpkg install openssl:x86-windows | |
New-Item -Path "C:\Program Files\OpenSSL" -ItemType SymbolicLink -Value "C:\vcpkg\packages\openssl_x86-windows\" | |
- uses: pypa/cibuildwheel@v2.22.0 | |
if: steps.cache-wheel.outputs.cache-hit != 'true' | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: wheelhouse/*.whl | |
name: wheels-${{ matrix.os }}-${{ matrix.CIBW_BUILD }} | |
upload_pypi: | |
needs: build_wheels | |
runs-on: ubuntu-latest | |
if: needs.build_wheels.result == 'success' && github.event.inputs.publish == 'PUBLISH' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-${{ matrix.os }}-${{ matrix.CIBW_BUILD }} | |
path: wheelhouse | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
packages-dir: wheelhouse | |
skip-existing: true | |
upload_pypi_test: | |
needs: build_wheels | |
runs-on: ubuntu-latest | |
if: needs.build_wheels.result == 'success' && github.event.inputs.publish_test == 'PUBLISH_TEST' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: wheels-${{ matrix.os }}-${{ matrix.CIBW_BUILD }} | |
path: wheelhouse | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
packages-dir: wheelhouse | |
skip-existing: true | |
repository_url: https://test.pypi.org/legacy/ |