pin nanobind version #31
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 | |
# Trigger on PR and only if something is tagged on branches | |
on: | |
push: | |
branches: ["*"] | |
tags: ["*"] | |
pull_request: | |
branches: ["*"] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-2022, macos-14] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: True | |
# Used to host cibuildwheel | |
- uses: actions/setup-python@v5 | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.15 | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: ./wheelhouse/*.whl | |
publish: | |
name: Publish to PyPI | |
needs: build_wheels | |
runs-on: ubuntu-latest | |
# Only publish to PyPI when a commit is tagged | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: True | |
- uses: actions/setup-python@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
path: wheelhouse | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
# construct the source package and upload src and wheels to PiPy | |
run: | | |
python -m pip install twine | |
python setup.py sdist | |
twine upload dist/* | |
twine upload wheelhouse/*.whl |