diff --git a/.github/workflows/upload_to_pypi.yml b/.github/workflows/upload_to_pypi.yml index e6ee04f..480b1e7 100644 --- a/.github/workflows/upload_to_pypi.yml +++ b/.github/workflows/upload_to_pypi.yml @@ -2,7 +2,10 @@ name: Build and upload to PyPI on: release: - types: [published] + types: [published, edited] + push: +# branches: +# - main jobs: build_wheels: @@ -25,10 +28,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: @@ -50,19 +54,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 }} diff --git a/pyproject.toml b/pyproject.toml index 4d11fc5..474f977 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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'