Skip to content

Commit

Permalink
Move Trusted Publishing to a dedicated step
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
shenanigansd authored Feb 4, 2024
1 parent 435670b commit c9dfa80
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/python-pypi-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ on:
types: [published]

jobs:
build-publish:
name: "Build and publish Python 🐍 distributions πŸ“¦ to PyPI"
build:
name: "Build distribution πŸ“¦"
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write

steps:
- name: "Checkout repository"
Expand Down Expand Up @@ -40,11 +37,27 @@ jobs:
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: packages
path: dist
path: dist/

- name: "Publish distribution πŸ“¦ to PyPI"
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11
with:
skip-existing: true
publish-to-pypi:
name: "Publish Python 🐍 distribution πŸ“¦ to PyPI"
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/letsbuilda-pypi/
permissions:
id-token: write

steps:
- name: "Download dists"
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: "Publish distribution πŸ“¦ to PyPI"
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11
with:
verbose: true
print-hash: true

0 comments on commit c9dfa80

Please sign in to comment.