Skip to content

Commit

Permalink
Only publish to test PyPI from the _test_release.yml workflow. (#12668
Browse files Browse the repository at this point in the history
)

PyPI trusted publishing wants to know which workflow is expected to do
the publish. We always want to publish from the same workflow, so we're
making `_test_release.yml` the only workflow that publishes to Test
PyPI.
  • Loading branch information
obi1kenobi authored Nov 1, 2023
1 parent 321cd44 commit 0ea8374
Showing 1 changed file with 5 additions and 29 deletions.
34 changes: 5 additions & 29 deletions .github/workflows/_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,35 +64,11 @@ jobs:
test-pypi-publish:
needs:
- build
runs-on: ubuntu-latest
permissions:
# This permission is used for trusted publishing:
# https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/
#
# Trusted publishing has to also be configured on PyPI for each package:
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/
id-token: write

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
with:
name: dist
path: ${{ inputs.working-directory }}/dist/

- name: Publish to test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ inputs.working-directory }}/dist/
verbose: true
print-hash: true
repository-url: https://test.pypi.org/legacy/

# We overwrite any existing distributions with the same name and version.
# This is *only for CI use* and is *extremely dangerous* otherwise!
# https://github.com/pypa/gh-action-pypi-publish#tolerating-release-package-file-duplicates
skip-existing: true
uses:
./.github/workflows/_test_release.yml
with:
working-directory: ${{ inputs.working-directory }}
secrets: inherit

pre-release-checks:
needs:
Expand Down

0 comments on commit 0ea8374

Please sign in to comment.