@@ -44,10 +44,11 @@ Let's begin! 🚀
44
44
the name of the release workflow file under
45
45
the ``.github/ `` folder, see :ref: `workflow-definition `.
46
46
Finally add the name of the GitHub Actions environment
47
- set up under your repository.
47
+ (`` pypi ``) we're going set up under your repository.
48
48
Register the trusted publisher.
49
49
3. Now, go to https://test.pypi.org/manage/account/publishing/ and repeat
50
- the second step.
50
+ the second step, but now enter ``testpypi `` as the name of the
51
+ GitHub Actions environment.
51
52
4. Your "pending" publishers are now ready for their first use and will
52
53
create your projects automatically once you use them
53
54
for the first time.
@@ -76,6 +77,11 @@ should make GitHub run this workflow:
76
77
:language: yaml
77
78
:end-before: jobs:
78
79
80
+ This will also assure that the release workflow is only triggered
81
+ if the current commit is tagged. It is recommended you use the
82
+ latest release tag; a tool like GitHub's dependabot can keep
83
+ these updated regularly.
84
+
79
85
Checking out the project and building distributions
80
86
===================================================
81
87
@@ -101,7 +107,7 @@ So add this to the steps list:
101
107
.. literalinclude :: github-actions-ci-cd-sample/publish-to-test-pypi.yml
102
108
:language: yaml
103
109
:start-after: version: "3.x"
104
- :end-before: build-n- publish-pypi
110
+ :end-before: publish-to -pypi
105
111
106
112
Defining a workflow job environment
107
113
===================================
@@ -125,15 +131,12 @@ Finally, add the following steps at the end:
125
131
126
132
.. literalinclude :: github-actions-ci-cd-sample/publish-to-test-pypi.yml
127
133
:language: yaml
128
- :lines: 39-47
134
+ :lines: 41-48
129
135
130
136
This step uses the `pypa/gh-action-pypi-publish `_ GitHub
131
137
Action: After the stored distribution package has been
132
138
downloaded by the `download-artifact `_ action, it uploads
133
- the contents of the ``dist/ `` folder into PyPI unconditionally,
134
- but only if the current commit is tagged. It is recommended you
135
- use the latest release tag; a tool like GitHub's dependabot can keep
136
- these updated regularly.
139
+ the contents of the ``dist/ `` folder into PyPI unconditionally.
137
140
138
141
Separate workflow for publishing to TestPyPI
139
142
============================================
0 commit comments