Merge pull request #85 from saimn/numpy-2.0 #79
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 and upload to PyPI | |
# Build on every branch push, tag push, and pull request change: | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
# macos-13 is an intel runner, macos-14 is apple silicon | |
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-${{ matrix.os }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.12' | |
- name: Build sdist | |
run: | | |
python -m pip install build | |
python -m build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: sdist | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
# upload to PyPI on every tag | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sdist | |
path: dist | |
- uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
pattern: wheels-* | |
- uses: pypa/gh-action-pypi-publish@v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_token }} | |
# To test: repository_url: https://test.pypi.org/legacy/ |