diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aef22a8ded..f03820d08d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -60,15 +60,3 @@ jobs: shell: bash env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} - - # Trigger Python release after crate publishing completes. - # Only runs for tag pushes; for manual Python releases, use workflow_dispatch on release_python.yml directly. - release-python: - needs: [publish] - if: ${{ startsWith(github.ref, 'refs/tags/') }} - permissions: - contents: read - id-token: write # Required for PyPI trusted publishing in the called workflow - uses: ./.github/workflows/release_python.yml - with: - release_tag: ${{ github.ref_name }} diff --git a/.github/workflows/release_python.yml b/.github/workflows/release_python.yml index 91fa4e3333..fc348a5350 100644 --- a/.github/workflows/release_python.yml +++ b/.github/workflows/release_python.yml @@ -18,12 +18,14 @@ name: Publish Python 🐍 distribution 📦 to PyPI on: - workflow_call: - inputs: - release_tag: - description: 'Release tag (e.g., v0.4.0 or v0.4.0-rc.1)' - required: true - type: string + # Given PyPI doesn't support workflow reuse, + # this workflow independently releases PyPI artifacts rather than being called by the crates release workflow. + push: + tags: + # Trigger this workflow when tag follows the versioning format: v.. OR v..-rc. + # Example valid tags: v0.4.0, v0.4.0-rc.1 + - "v[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+" workflow_dispatch: inputs: release_tag: @@ -190,7 +192,7 @@ jobs: - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 with: version: "0.9.3" - enable-cache: true + enable-cache: false # Do not use cache for release artifacts # Verify the wheel is abi3-compatible and installable without building from source. # Skipped for cross-compiled targets since they share the same maturin config; # if abi3 is broken, the native target build will catch it. @@ -225,9 +227,12 @@ jobs: pattern: wheels-* merge-multiple: true path: bindings/python/dist + + # Note: PyPI publish must always be in the top-level workflow + # Workflow reuse is not supported by PyPI: https://github.com/pypi/warehouse/issues/11096 - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 with: - skip-existing: true + skip-existing: false packages-dir: bindings/python/dist verbose: true