Build CI wheels #602
Workflow file for this run
This file contains hidden or 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: Build CI wheels | |
on: | |
# Save CI by only running this on release branches or tags. | |
push: | |
branches: | |
- main | |
- v[0-9]+.[0-9]+.x | |
tags: | |
- v* | |
# Also allow running this action on PRs if requested by applying the | |
# "Run cibuildwheel" label. | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- labeled | |
permissions: | |
contents: read | |
jobs: | |
build_wheels: | |
if: | | |
github.event_name == 'push' || | |
github.event_name == 'pull_request' && ( | |
( | |
github.event.action == 'labeled' && | |
github.event.label.name == 'CI: Run cibuildwheel' | |
) || | |
contains(github.event.pull_request.labels.*.name, 'CI: Run cibuildwheel') | |
) | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64" | |
MACOSX_DEPLOYMENT_TARGET: "10.12" | |
CIBW_BEFORE_BUILD_WINDOWS: >- | |
pip install certifi delvewheel oldest-supported-numpy && | |
git clean -fxd build | |
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >- | |
delvewheel repair -w {dest_dir} {wheel} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, windows-latest, macos-11] | |
cibw_archs: ["auto"] | |
include: | |
- os: ubuntu-20.04 | |
cibw_archs: "aarch64" | |
steps: | |
- name: Set up QEMU | |
if: matrix.cibw_archs == 'aarch64' | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: arm64 | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
# Something changed somewhere that prevents the downloaded-at-build-time | |
# licenses from being included in built wheels, so pre-download them so | |
# that they exist before the build and are included. | |
- name: Pre-download bundled licenses | |
run: > | |
curl -Lo LICENSE/LICENSE_QHULL | |
https://github.com/qhull/qhull/raw/2020.2/COPYING.txt | |
- name: Build wheels for CPython 3.12 | |
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5 | |
env: | |
CIBW_BUILD: "cp312-*" | |
CIBW_SKIP: "*-musllinux* *i686* *win32*" | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_MANYLINUX_I686_IMAGE: manylinux2014 | |
MPL_DISABLE_FH4: "yes" | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
# Remove this once NumPy with Python 3.12 wheels is not pre-release. | |
CIBW_BEFORE_BUILD: >- | |
pip install certifi "Cython>=0.29.34,<3.1" "pybind11>=2.6" "pyproject-metadata >= 0.7.1" "setuptools>=60" "setuptools_scm>=7" && | |
pip install --pre "numpy>=1.25" && | |
rm -rf {package}/build | |
CIBW_BEFORE_BUILD_WINDOWS: >- | |
pip install certifi colorama "Cython>=0.29.34,<3.1" delvewheel "pybind11>=2.6" "pyproject-metadata >= 0.7.1" "setuptools>=60" "setuptools_scm>=7" && | |
pip install --pre "numpy>=1.25" && | |
rm -rf {package}/build | |
CIBW_ENVIRONMENT: PIP_NO_BUILD_ISOLATION=0 | |
# Remove this once contourpy has Python 3.12 wheels. | |
CIBW_BEFORE_TEST: >- | |
pip install "meson>=1.2.0" "meson-python>=0.13.1" "ninja" "pybind11>=2.10.4" && | |
pip install --pre "numpy>=1.25" | |
- name: Build wheels for CPython 3.11 | |
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5 | |
env: | |
CIBW_BUILD: "cp311-*" | |
CIBW_SKIP: "*-musllinux*" | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_MANYLINUX_I686_IMAGE: manylinux2014 | |
CIBW_BEFORE_BUILD: >- | |
pip install certifi oldest-supported-numpy && | |
git clean -fxd build | |
MPL_DISABLE_FH4: "yes" | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
- name: Build wheels for CPython 3.10 | |
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5 | |
env: | |
CIBW_BUILD: "cp310-*" | |
CIBW_SKIP: "*-musllinux*" | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_MANYLINUX_I686_IMAGE: manylinux2014 | |
CIBW_BEFORE_BUILD: >- | |
pip install certifi oldest-supported-numpy && | |
git clean -fxd build | |
MPL_DISABLE_FH4: "yes" | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
- name: Build wheels for CPython 3.9 | |
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5 | |
env: | |
CIBW_BUILD: "cp39-*" | |
CIBW_SKIP: "*-musllinux*" | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_MANYLINUX_I686_IMAGE: manylinux2014 | |
CIBW_BEFORE_BUILD: >- | |
pip install certifi oldest-supported-numpy && | |
git clean -fxd build | |
MPL_DISABLE_FH4: "yes" | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
- name: Build wheels for CPython 3.8 | |
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5 | |
env: | |
CIBW_BUILD: "cp38-*" | |
CIBW_SKIP: "*-musllinux*" | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2010 | |
CIBW_MANYLINUX_I686_IMAGE: manylinux2010 | |
CIBW_BEFORE_BUILD: >- | |
pip install certifi numpy==1.19.2 && | |
git clean -fxd build | |
MPL_DISABLE_FH4: "yes" | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
- name: Build wheels for PyPy 3.8 | |
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5 | |
env: | |
CIBW_BUILD: "pp38-*" | |
CIBW_SKIP: "*-musllinux*" | |
CIBW_BEFORE_BUILD: >- | |
pip install certifi oldest-supported-numpy && | |
git clean -fxd build | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
if: matrix.cibw_archs != 'aarch64' | |
- name: Build wheels for PyPy 3.9 | |
uses: pypa/cibuildwheel@ce3fb7832089eb3e723a0a99cab7f3eaccf074fd # v2.16.5 | |
env: | |
CIBW_BUILD: "pp39-*" | |
CIBW_SKIP: "*-musllinux*" | |
CIBW_BEFORE_BUILD: >- | |
pip install certifi "Cython>=0.29.34,<3.0" "pybind11>=2.6" "setuptools>=42" "setuptools_scm>=7" && | |
pip install "numpy~=1.25.0" && | |
git clean -fxd build | |
CIBW_BEFORE_BUILD_WINDOWS: >- | |
pip install certifi delvewheel "pybind11>=2.6" "setuptools>=42" "setuptools_scm>=7" && | |
pip install "numpy>=1.25" && | |
git clean -fxd build | |
CIBW_ARCHS: ${{ matrix.cibw_archs }} | |
CIBW_ENVIRONMENT: PIP_NO_BUILD_ISOLATION=0 PIP_NO_DEPENDENCIES=0 | |
if: matrix.cibw_archs != 'aarch64' | |
- name: Validate that LICENSE files are included in wheels | |
run: | | |
python3 ./ci/check_wheel_licenses.py | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: ./wheelhouse/*.whl | |
if-no-files-found: error |