From c0e435cecf1d643a97c67b265e36841a90f40042 Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Sun, 15 Dec 2024 21:25:45 +0000 Subject: [PATCH] Update upload_to_pypi.yml --- .github/workflows/upload_to_pypi.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/upload_to_pypi.yml b/.github/workflows/upload_to_pypi.yml index e6ee04f..b7694f5 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: @@ -17,18 +20,17 @@ jobs: - uses: actions/setup-python@v5 name: Install Python - with: - python-version: '3.x' - name: Build wheels # For very recent Python versions, wheels from e.g. numpy might not be # 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: @@ -39,8 +41,6 @@ jobs: - uses: actions/setup-python@v5 name: Install Python - with: - python-version: '3.x' - name: Install build run: python -m pip install build @@ -50,17 +50,22 @@ 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: