Skip to content

Commit

Permalink
Fix build matrix and PyPI upload (#30)
Browse files Browse the repository at this point in the history
* Fix artefact upload names

* Set build requirement numpy<2 for python < 3.9
  • Loading branch information
lukeshingles committed Dec 15, 2024
1 parent 0bc5722 commit 654c684
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/upload_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and upload to PyPI

on:
release:
types: [published]
types: [published, edited]

jobs:
build_wheels:
Expand All @@ -25,10 +25,11 @@ jobs:
# available yet which can cause the build to fail. Keep going, and upload
# the wheels for all of the previous versions when that happens.
continue-on-error: true
uses: pypa/cibuildwheel@v2.20.0
uses: pypa/cibuildwheel@v2.22.0

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
Expand All @@ -50,19 +51,21 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
name: Upload to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
id-token: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [
"wheel",
"setuptools",
"Cython>=0.29.2",
"oldest-supported-numpy; python_version<'3.9'",
"numpy<2; python_version<'3.9'",
"numpy>=2; python_version>='3.9'",
]
build-backend = 'setuptools.build_meta'

0 comments on commit 654c684

Please sign in to comment.