Skip to content

Commit b869257

Browse files
committed
Add guidance for trusted publishing
1 parent 045e236 commit b869257

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,31 @@ Let's begin! 🚀
5151
create it. It's not the same as a regular PyPI account.
5252

5353

54+
Using trusted publishing
55+
------------------------
56+
57+
It is also possible to authenticate to PyPI without having to provide
58+
an `API token`_. This can be done using
59+
PyPI's `trusted publishing`_ implementation. This is recommended
60+
also for security reasons, since the generated tokens are created for each of your projects
61+
individually and expire automatically.
62+
63+
The following steps will lead you through creating a "pending" publisher.
64+
65+
1. Go to https://pypi.org/manage/account/publishing/
66+
2. Now fill in the name you wish to publish your new project under,
67+
your repository data and the name of the release workflow file
68+
under the ``.github/`` folder, see :ref:`workflow-definition`.
69+
Finally add the name of the GitHub Actions environment
70+
running under your repository.
71+
Add the trusted publisher.
72+
3. Your "pending" publisher is no ready for its first use and will
73+
create your project automatically once you use it
74+
for the first time.
75+
76+
77+
.. _workflow-definition:
78+
5479
Creating a workflow definition
5580
==============================
5681

@@ -150,3 +175,4 @@ sure that your release pipeline remains healthy!
150175
https://github.com/marketplace/actions/pypi-publish
151176
.. _Secrets:
152177
https://docs.github.com/en/actions/reference/encrypted-secrets
178+
.. _trusted publishing: https://docs.pypi.org/trusted-publishers/

0 commit comments

Comments
 (0)