Skip to content

Commit aff5ef3

Browse files
committed
Remove GH release from pypi workflow
The step to create GH release is clunky, confusing, and fails most of the time. The code was supposed to be triggered on a new tag, but it's simpler to create a release from the GH dashboard and let it create the tag as well, which triggers pypi. The workflow now mirrors the one from packaging.python.org page https://packaging.python.org/en/latest/guides/ publishing-package-distribution-releases-using- github-actions-ci-cd-workflows/#the-whole-ci-cd-workflow Signed-off-by: Nicola Sella <[email protected]>
1 parent 0fd4e55 commit aff5ef3

File tree

1 file changed

+2
-46
lines changed

1 file changed

+2
-46
lines changed

.github/workflows/publish-to-test-pypi.yml

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v5
15+
with:
16+
persist-credentials: false
1517
- name: Set up Python
1618
uses: actions/setup-python@v6
1719
with:
1820
python-version: "3.x"
19-
2021
- name: Install pypa/build
2122
run: >-
2223
python3 -m
@@ -53,51 +54,6 @@ jobs:
5354
- name: Publish distribution 📦 to PyPI
5455
uses: pypa/gh-action-pypi-publish@release/v1
5556

56-
github-release:
57-
name: >-
58-
Sign the Python 🐍 distribution 📦 with Sigstore
59-
and upload them to GitHub Release
60-
if: github.repository == 'containers/podman-py'
61-
needs:
62-
- publish-to-pypi
63-
runs-on: ubuntu-latest
64-
65-
permissions:
66-
contents: write # IMPORTANT: mandatory for making GitHub Releases
67-
id-token: write # IMPORTANT: mandatory for sigstore
68-
69-
steps:
70-
- name: Download all the dists
71-
uses: actions/download-artifact@v5
72-
with:
73-
name: python-package-distributions
74-
path: dist/
75-
- name: Sign the dists with Sigstore
76-
uses: sigstore/[email protected]
77-
with:
78-
inputs: >-
79-
./dist/*.tar.gz
80-
./dist/*.whl
81-
82-
- name: Create GitHub Release
83-
env:
84-
GITHUB_TOKEN: ${{ github.token }}
85-
run: >-
86-
gh release create
87-
'${{ github.ref_name }}'
88-
--repo '${{ github.repository }}'
89-
--generate-notes
90-
- name: Upload artifact signatures to GitHub Release
91-
env:
92-
GITHUB_TOKEN: ${{ github.token }}
93-
# Upload to GitHub Release using the `gh` CLI.
94-
# `dist/` contains the built packages, and the
95-
# sigstore-produced signatures and certificates.
96-
run: >-
97-
gh release upload
98-
'${{ github.ref_name }}' dist/**
99-
--repo '${{ github.repository }}'
100-
10157
publish-to-testpypi:
10258
name: Publish Python 🐍 distribution 📦 to TestPyPI
10359
if: github.repository == 'containers/podman-py'

0 commit comments

Comments
 (0)