Skip to content

Commit 73725c7

Browse files
committed
Address more review comments
1 parent 7b86e9c commit 73725c7

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

source/guides/github-actions-ci-cd-sample/publish-to-test-pypi.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ jobs:
3636
runs-on: ubuntu-latest
3737
environment:
3838
name: pypi
39-
# Fill in your project (e.g. repository) name
40-
# for <package-name>
39+
# Fill in your project (e.g. repository) name for <package-name>
4140
url: https://pypi.org/p/<package-name>
4241
permissions:
4342
id-token: write # IMPORTANT: mandatory for trusted publishing
@@ -64,21 +63,24 @@ jobs:
6463
id-token: write # IMPORTANT: mandatory for sigstore
6564

6665
steps:
67-
- name: Sign the dists with Sigstore
68-
uses: sigstore/[email protected]
69-
with:
70-
inputs: >-
71-
./dist/*.tar.gz
72-
./dist/*.whl
73-
- name: Upload artifact signatures to GitHub Release
74-
# Confusingly, this action also supports updating releases, not
75-
# just creating them. This is what we want here, since we've manually
76-
# created the release above.
77-
uses: softprops/action-gh-release@v1
78-
with:
79-
# `dist/` contains the built packages, and the
80-
# sigstore-produced signatures and certificates.
81-
files: dist/**
66+
- name: Download all the dists
67+
uses: actions/download-artifact@v3
68+
with:
69+
name: python-package-distributions
70+
path: dist/
71+
- name: Sign the dists with Sigstore
72+
uses: sigstore/[email protected]
73+
with:
74+
inputs: >-
75+
./dist/*.tar.gz
76+
./dist/*.whl
77+
- name: Upload artifact signatures to GitHub Release
78+
env:
79+
GH_TOKEN: ${{ github.token }}
80+
# Upload to GitHub Release using the `gh` CLI.
81+
# `dist/` contains the built packages, and the
82+
# sigstore-produced signatures and certificates.
83+
run: gh release upload "${{ github.ref_name }}" dist/** --repo "${{ github.repository }}"
8284

8385
publish-to-testpypi:
8486
name: Publish Python 🐍 distribution 📦 to TestPyPI

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ them to GitHub Release.
170170
:start-at: github-release:
171171
:end-before: publish-to-testpypi
172172

173+
174+
.. note::
175+
176+
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+
180+
173181
Separate workflow for publishing to TestPyPI
174182
============================================
175183

@@ -181,10 +189,12 @@ section:
181189
:language: yaml
182190
:start-at: publish-to-testpypi
183191

184-
The whole CD workflow
185-
=====================
192+
The whole CI/CD workflow
193+
========================
194+
195+
This paragraph showcases the whole workflow after following the above guide.
186196

187-
.. collapse:: Load file
197+
.. collapse:: Click here to display the entire GitHub Actions CI/CD workflow definition
188198

189199
.. literalinclude:: github-actions-ci-cd-sample/publish-to-test-pypi.yml
190200
:language: yaml

0 commit comments

Comments
 (0)