Skip to content

Commit a5e6fd9

Browse files
Fix PyPI CD
This fixes two problems with the PyPI CD: It did not handle prereleases, and the github.event.name filter did not work. It now uses types: [published] as a trigger as recommended here: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#release And it uses github.event_name as a filter as documented here: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#github-context
1 parent c2ccf66 commit a5e6fd9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/cd-pypi.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
pull_request:
66
release:
7-
types: [released]
7+
types: [published]
88

99
env:
1010
POETRY_SPEC: poetry >=1,<2
@@ -46,7 +46,7 @@ jobs:
4646
name: Publish to TestPyPI
4747
runs-on: ubuntu-latest
4848
needs: build
49-
if: github.event.name == 'release' || github.ref == 'refs/heads/main'
49+
if: github.event_name == 'release' || github.ref == 'refs/heads/main'
5050
environment:
5151
name: testpypi
5252
url: https://test.pypi.org/p/nitrokey
@@ -69,7 +69,7 @@ jobs:
6969
name: Check tag version
7070
runs-on: ubuntu-latest
7171
container: python:3.9-slim
72-
if: github.event.name == 'release'
72+
if: github.event_name == 'release'
7373
steps:
7474
- name: Checkout repository
7575
uses: actions/checkout@v4
@@ -87,7 +87,7 @@ jobs:
8787
name: Publish to PyPI
8888
runs-on: ubuntu-latest
8989
needs: [build, check-tag-version]
90-
if: github.event.name == 'release'
90+
if: github.event_name == 'release'
9191
environment:
9292
name: pypi
9393
url: https://pypi.org/p/nitrokey

0 commit comments

Comments
 (0)