Merge pull request #302 from OpenChemistry/bump #15
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: | |
branches: | |
- master | |
tags: | |
- '*' | |
pull_request: | |
env: | |
# Only support 64-bit CPython > 3.6 | |
CIBW_SKIP: "cp36-* pp* *-manylinux_i686 *-musllinux_* *-win32" | |
# This has some of the software we need pre-installed on it | |
CIBW_MANYLINUX_X86_64_IMAGE: openchemistry/stempy_wheel_builder | |
# Need to do some setup before repairing the wheel on linux... | |
CIBW_REPAIR_WHEEL_COMMAND_LINUX: bash .github/scripts/repair_command_linux.sh | |
# Specify eigen location for windows, and force it to use python in the path... | |
CIBW_ENVIRONMENT_WINDOWS: > | |
EXTRA_CMAKE_ARGS="-DEIGEN3_INCLUDE_DIR=C:\\eigen;-Dstempy_ENABLE_HDF5=OFF" | |
USE_PYTHON_IN_PATH=1 | |
# Get cmake to use python in the path... | |
CIBW_ENVIRONMENT_MACOS: USE_PYTHON_IN_PATH=1 | |
CIBW_BEFORE_TEST: pip install -r {project}/tests/requirements.txt | |
CIBW_TEST_COMMAND: pytest {project}/tests | |
CIBW_ARCHS_MACOS: x86_64 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-20.04, macos-latest, windows-2019] | |
steps: | |
- uses: actions/checkout@v3 | |
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 | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: '3.7' | |
- name: Install dependencies | |
run: . .github/scripts/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 }} |