diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2b4bd7..081a5a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,8 +15,6 @@ on: push: branches: - master - tags: - - '*' pull_request: workflow_call: @@ -88,30 +86,3 @@ jobs: with: name: wheels-macos-${{ matrix.platform.target }} path: dist - -# release: -# name: Release -# runs-on: ubuntu-latest -# if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} -# needs: [linux, macos, sdist] -# permissions: -# # Use to sign the release artifacts -# id-token: write -# # Used to upload release artifacts -# contents: write -# # Used to generate artifact attestation -# attestations: write -# steps: -# - uses: actions/download-artifact@v4 -# - name: Generate artifact attestation -# uses: actions/attest-build-provenance@v1 -# with: -# subject-path: 'wheels-*/*' -# - name: Publish to PyPI -# if: "startsWith(github.ref, 'refs/tags/')" -# uses: PyO3/maturin-action@v1 -# env: -# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} -# with: -# command: upload -# args: --non-interactive --skip-existing wheels-*/* diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..fc5944e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish Wheels + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + run-build-workflow: + uses: ./.github/workflows/build.yml + + pypi-publish: + name: Publish to PyPi + needs: run-build-workflow + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + pattern: wheels-* + merge-multiple: true + path: dist/ + - name: List artifacts downloaded + run: ls -R dist + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1.8