@@ -25,9 +25,9 @@ Configuring trusted publishing
2525This guide relies on PyPI's `trusted publishing `_ implementation to connect
2626to `GitHub Actions CI/CD `_. This is recommended for security reasons, since
2727the generated tokens are created for each of your projects
28- individually and expire automatically. Otherwise you'll need to generate an
28+ individually and expire automatically. Otherwise, you'll need to generate an
2929`API token `_ for both PyPI and TestPyPI. In case of publishing to third-party
30- indexes like :doc: `devpi <devpi:index >`, you will need to provide a
30+ indexes like :doc: `devpi <devpi:index >`, you may need to provide a
3131username/password combination.
3232
3333Since this guide will demonstrate uploading to both
@@ -77,7 +77,7 @@ should make GitHub run this workflow:
7777 :language: yaml
7878 :end-before: jobs:
7979
80- This will also assure that the release workflow is only triggered
80+ This will also ensure that the release workflow is only triggered
8181if the current commit is tagged. It is recommended you use the
8282latest release tag; a tool like GitHub's dependabot can keep
8383these updated regularly.
@@ -115,9 +115,11 @@ Defining a workflow job environment
115115Now, let's add initial setup for our job that will publish to PyPI.
116116It's a process that will execute commands that we'll define later.
117117In this guide, we'll use the latest stable Ubuntu LTS version
118- provided by GitHub Actions. This also defines the package index
119- to publish to, PyPI, and grants a permission to the action that
120- is mandatory for trusted publishing.
118+ provided by GitHub Actions. This also defines a GitHub Environment
119+ for the job to run in its context and a URL to be displayed in GitHub's
120+ UI nicely. Additionally, it allows aqcuiring an OpenID Connect token
121+ which is mandartory that the ``pypi-publish `` actions needs to
122+ implement secretless trusted publishing to PyPI.
121123
122124.. literalinclude :: github-actions-ci-cd-sample/publish-to-test-pypi.yml
123125 :language: yaml
@@ -134,9 +136,10 @@ Finally, add the following steps at the end:
134136 :lines: 41-48
135137
136138This step uses the `pypa/gh-action-pypi-publish `_ GitHub
137- Action: After the stored distribution package has been
139+ Action: after the stored distribution package has been
138140downloaded by the `download-artifact `_ action, it uploads
139141the contents of the ``dist/ `` folder into PyPI unconditionally.
142+ This job also signs the artifacts with Sigstore right after publishing them to PyPI.
140143
141144Separate workflow for publishing to TestPyPI
142145============================================
0 commit comments