Merge pull request #1384 from Surajjalpun2002/change2 #2148
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] | |
env: | |
# Don't build python 2.7, pypy, or 32-bit wheels or Mac arm64 on Py3.8 | |
CIBW_SKIP: "cp36-* cp37-* cp311-* 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: yum install -y git eigen3-devel | |
# 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@v4 | |
name: Install Python | |
with: | |
python-version: '3.7' | |
- name: Install cibuildwheel | |
run: pip install cibuildwheel==2.12.3 | |
- name: Install dependencies | |
run: . ./scripts/github-actions/install.sh | |
- name: Build wheels | |
run: cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
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@v3 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_api_token }} |