You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,15 +52,15 @@ Let's begin! 🚀
52
52
2. Fill in the name you wish to publish your new
53
53
:term:`PyPI project <Project>` under
54
54
(the ``name`` value in your ``setup.cfg`` or ``pyproject.toml``),
55
-
the GitHub repository owner's name (org or user)
56
-
and repository name and the name of the release workflow file under
55
+
the GitHub repository owner's name (org or user),
56
+
and repository name, and the name of the release workflow file under
57
57
the ``.github/`` folder, see :ref:`workflow-definition`.
58
-
Finally add the name of the GitHub Actions environment
58
+
Finally, add the name of the GitHub Environment
59
59
(``pypi``) we're going set up under your repository.
60
60
Register the trusted publisher.
61
61
3. Now, go to https://test.pypi.org/manage/account/publishing/ and repeat
62
-
the second step, but now enter ``testpypi`` as the name of the
63
-
GitHub Actions environment.
62
+
the second step, but this time, enter ``testpypi`` as the name of the
63
+
GitHub Environment.
64
64
4. Your "pending" publishers are now ready for their first use and will
65
65
create your projects automatically once you use them
66
66
for the first time.
@@ -71,9 +71,9 @@ Let's begin! 🚀
71
71
create it. It's not the same as a regular PyPI account.
72
72
73
73
74
-
.. hint::
74
+
.. attention::
75
75
76
-
For security reasons, you should require manual approval
76
+
For security reasons, you must require `manual approval<https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules>`_
77
77
on each run for the ``pypi`` environment.
78
78
79
79
@@ -140,7 +140,7 @@ trusted publishing to PyPI.
140
140
:end-before: steps:
141
141
142
142
This will also ensure that the PyPI publishing workflow is only triggered
143
-
if the current commit is tagged. It is recommended you use the
143
+
if the current commit is tagged. It is recommended that you commit using the
144
144
latest release tag.
145
145
146
146
Publishing the distribution to PyPI
@@ -161,9 +161,11 @@ the contents of the ``dist/`` folder into PyPI unconditionally.
161
161
Signing the distribution packages
162
162
=================================
163
163
164
-
This additional job signs the distribution packages with `Sigstore`_,
165
-
using the `sigstore/gh-action-sigstore-python GitHub Action`_,
166
-
and then uploads them to GitHub Release.
164
+
The following job signs the distribution packages with `Sigstore`_,
165
+
the same artifact signing system `used to sign CPython <https://www.python.org/download/sigstore/>`_.
166
+
167
+
It uses the `sigstore/gh-action-sigstore-python GitHub Action`_,
@@ -174,8 +176,8 @@ and then uploads them to GitHub Release.
174
176
.. note::
175
177
176
178
This is a replacement for GPG signatures, for which support has been
177
-
`removed <https://blog.pypi.org/posts/2023-05-23-removing-pgp/>`_ by PyPI.
178
-
However, this job is not mandatory for defining the workflow.
179
+
`removed from PyPI <https://blog.pypi.org/posts/2023-05-23-removing-pgp/>`_.
180
+
However, this job is not mandatory for uploading to PyPI and can be omitted.
179
181
180
182
181
183
Separate workflow for publishing to TestPyPI
@@ -189,6 +191,11 @@ section:
189
191
:language: yaml
190
192
:start-at: publish-to-testpypi
191
193
194
+
.. tip::
195
+
196
+
Requiring manual approvals in the ``testpypi`` GitHub Environment is typically unnecessary as it's designed to run on each commit to the main branch and is often used to indicate a healthy release publishing pipeline.
0 commit comments