Synchronize workflows #3581
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: Build Wheels | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
# Don't build python 2.7, pypy, or 32-bit wheels or Mac arm64 on Py3.8 | |
CIBW_SKIP: "cp36-* cp37-* cp311-manylinux* cp312-manylinux* cp38-macosx_arm64 pp* *-musllinux_* *-manylinux_i686 *-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 *_universal2: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: | |
# For Windows, we have to use visual studio 2017, which is on windows-2016 | |
os: [ubuntu-20.04, macos-latest, windows-2019] | |
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 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.8' | |
cache: 'pip' # caching pip dependencies | |
- name: Install cibuildwheel | |
run: pip install cibuildwheel==2.16.2 | |
- name: Install dependencies | |
run: . ./scripts/github-actions/install.sh | |
- name: Build wheels | |
run: cibuildwheel --output-dir wheelhouse | |
- 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: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_api_token }} |