Skip to content

Update cibuildwheel (#2010) #3970

Update cibuildwheel (#2010)

Update cibuildwheel (#2010) #3970

Workflow file for this run

name: Build Wheels
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# builds to skip (e.g. skip 32-bit windows)
CIBW_SKIP: "cp38-macosx_arm64 *-manylinux_i686 *-musllinux_* *-win32"
# Need to do some setup before repairing the wheel on linux...
CIBW_REPAIR_WHEEL_COMMAND_LINUX: bash scripts/github-actions/repair_command_linux.sh
CIBW_BEFORE_ALL_LINUX: bash scripts/github-actions/repair-linux.sh
# Specify eigen location for windows
CIBW_ENVIRONMENT_WINDOWS: "EXTRA_CMAKE_ARGS=-DEIGEN3_INCLUDE_DIR:PATH=/c/eigen"
# On Mac build both x64 and arm64
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_TEST_REQUIRES: pytest
# Run a very simple test to make sure the wheels are working
CIBW_TEST_COMMAND: pytest {project}/scripts/github-actions/simple_test.py
# We can't currently test Mac arm64 builds on x64
CIBW_TEST_SKIP: "*_arm64"
# Use bash by default for the run command
defaults:
run:
shell: bash
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
with:
# Grab the whole history so that setuptools-scm can see the tags and
# give it a correct version even on non-tag push.
fetch-depth: 0
- name: Install dependencies
run: . ./scripts/github-actions/install.sh
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
upload_pypi:
needs: build_wheels
name: Upload wheels to PyPI
runs-on: ubuntu-latest
# upload to PyPI on every tag push
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_api_token }}