diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 1dd4569..156537e 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -109,7 +109,6 @@ jobs: runs-on: ubuntu-latest environment: pypi permissions: - contents: write id-token: write steps: - name: Download dist artifacts @@ -118,18 +117,25 @@ jobs: name: dist path: dist/ + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + # No API token needed - uses OIDC trusted publishing. + # Configure at: https://pypi.org/manage/project/cptr/settings/publishing/ + + github-release-assets: + needs: build + if: needs.build.outputs.skip != 'true' + runs-on: ubuntu-latest + permissions: + contents: write + steps: - name: Download release artifacts uses: actions/download-artifact@v4 with: name: release-assets path: release-assets/ - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - # No API token needed - uses OIDC trusted publishing. - # Configure at: https://pypi.org/manage/project/cptr/settings/publishing/ - - - name: Upload GitHub release artifacts + - name: Attach GitHub release artifacts env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} VERSION: ${{ needs.build.outputs.version }}