@@ -21,10 +21,10 @@ for temporarily storing and downloading the source packages.
2121 details of building platform specific projects. If you have binary
2222 components, check out :ref: `cibuildwheel `'s GitHub Action examples.
2323
24- Configuring trusted publishing
24+ Configuring Trusted Publishing
2525==============================
2626
27- This guide relies on PyPI's `trusted publishing `_ implementation to connect
27+ This guide relies on PyPI's `Trusted Publishing `_ implementation to connect
2828to `GitHub Actions CI/CD `_. This is recommended for security reasons, since
2929the generated tokens are created for each of your projects
3030individually and expire automatically. Otherwise, you'll need to generate an
@@ -36,7 +36,7 @@ Since this guide will demonstrate uploading to both
3636PyPI and TestPyPI, we'll need two trusted publishers configured.
3737The following steps will lead you through creating the "pending" publishers
3838for your new :term: `PyPI project <Project> `.
39- However it is also possible to add `trusted publishing `_ to any
39+ However it is also possible to add `Trusted Publishing `_ to any
4040pre-existing project, if you are its owner.
4141
4242.. attention ::
@@ -134,7 +134,7 @@ provided by GitHub Actions. This also defines a GitHub Environment
134134for the job to run in its context and a URL to be displayed in GitHub's
135135UI nicely. Additionally, it allows acquiring an OpenID Connect token
136136that the ``pypi-publish `` actions needs to implement secretless
137- trusted publishing to PyPI.
137+ Trusted Publishing to PyPI.
138138
139139.. literalinclude :: github-actions-ci-cd-sample/publish-to-test-pypi.yml
140140 :language: yaml
@@ -152,46 +152,20 @@ Finally, add the following steps at the end:
152152.. literalinclude :: github-actions-ci-cd-sample/publish-to-test-pypi.yml
153153 :language: yaml
154154 :start-after: id-token: write
155- :end-before: github-release :
155+ :end-before: publish-to-testpypi :
156156
157157This step uses the `pypa/gh-action-pypi-publish `_ GitHub
158158Action: after the stored distribution package has been
159159downloaded by the `download-artifact `_ action, it uploads
160160the contents of the ``dist/ `` folder into PyPI unconditionally.
161161
162- Signing the distribution packages
163- =================================
164-
165- The following job signs the distribution packages with `Sigstore `_,
166- the same artifact signing system `used to sign CPython <https://www.python.org/download/sigstore/ >`_.
167-
168- Firstly, it uses the `sigstore/gh-action-sigstore-python GitHub Action `_
169- to sign the distribution packages. In the next step, an empty GitHub Release
170- from the current tag is created using the ``gh `` CLI. Note this step can be further
171- customised. See the `gh release documentation <https://cli.github.com/manual/gh_release >`_
172- as a reference.
173-
174162.. tip ::
175163
176- You may need to manage your ``GITHUB_TOKEN `` permissions to
177- enable creating the GitHub Release. See the `GitHub
178- documentation <https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-default-github_token-permissions> `_
179- for instructions. Specifically, the token needs the
180- ``contents: write `` permission.
181-
182- Finally, the signed distributions are uploaded to the GitHub Release.
183-
184- .. literalinclude :: github-actions-ci-cd-sample/publish-to-test-pypi.yml
185- :language: yaml
186- :start-at: github-release:
187- :end-before: publish-to-testpypi
188-
189-
190- .. note ::
191-
192- This is a replacement for GPG signatures, for which support has been
193- `removed from PyPI <https://blog.pypi.org/posts/2023-05-23-removing-pgp/ >`_.
194- However, this job is not mandatory for uploading to PyPI and can be omitted.
164+ Starting with version
165+ `v1.11.0 <https://github.com/pypa/gh-action-pypi-publish/releases/tag/v1.11.0 >`_,
166+ `pypa/gh-action-pypi-publish `_ generates and uploads :pep: `740 `-compatible
167+ attestations for each distribution by default. No additional manual
168+ signing steps are required.
195169
196170
197171Separate workflow for publishing to TestPyPI
@@ -254,9 +228,6 @@ sure that your release pipeline remains healthy!
254228 https://github.com/actions/download-artifact
255229.. _`upload-artifact` :
256230 https://github.com/actions/upload-artifact
257- .. _Sigstore : https://www.sigstore.dev/
258- .. _`sigstore/gh-action-sigstore-python GitHub Action` :
259- https://github.com/marketplace/actions/gh-action-sigstore-python
260231.. _Secrets :
261232 https://docs.github.com/en/actions/reference/encrypted-secrets
262- .. _ trusted publishing : https://docs.pypi.org/trusted-publishers/
233+ .. _ Trusted Publishing : https://docs.pypi.org/trusted-publishers/
0 commit comments