@@ -25,9 +25,9 @@ Configuring trusted publishing
25
25
This guide relies on PyPI's `trusted publishing `_ implementation to connect
26
26
to `GitHub Actions CI/CD `_. This is recommended for security reasons, since
27
27
the 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
29
29
`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
31
31
username/password combination.
32
32
33
33
Since this guide will demonstrate uploading to both
@@ -77,7 +77,7 @@ should make GitHub run this workflow:
77
77
:language: yaml
78
78
:end-before: jobs:
79
79
80
- This will also assure that the release workflow is only triggered
80
+ This will also ensure that the release workflow is only triggered
81
81
if the current commit is tagged. It is recommended you use the
82
82
latest release tag; a tool like GitHub's dependabot can keep
83
83
these updated regularly.
@@ -115,9 +115,11 @@ Defining a workflow job environment
115
115
Now, let's add initial setup for our job that will publish to PyPI.
116
116
It's a process that will execute commands that we'll define later.
117
117
In 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.
121
123
122
124
.. literalinclude :: github-actions-ci-cd-sample/publish-to-test-pypi.yml
123
125
:language: yaml
@@ -134,9 +136,10 @@ Finally, add the following steps at the end:
134
136
:lines: 41-48
135
137
136
138
This 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
138
140
downloaded by the `download-artifact `_ action, it uploads
139
141
the contents of the ``dist/ `` folder into PyPI unconditionally.
142
+ This job also signs the artifacts with Sigstore right after publishing them to PyPI.
140
143
141
144
Separate workflow for publishing to TestPyPI
142
145
============================================
0 commit comments