Skip to content

Commit dd53c2a

Browse files
Use PYPI_TOKEN secret for publish workflow
Switch from OIDC trusted publishing to API token auth, and accept SemVer tags without the v prefix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a7cfda4 commit dd53c2a

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish to PyPI
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- '[0-9]+.[0-9]+.[0-9]+*'
77
workflow_dispatch:
88
inputs:
99
dry_run:
@@ -14,7 +14,6 @@ on:
1414

1515
permissions:
1616
contents: read
17-
id-token: write # Required for PyPI trusted publishing
1817

1918
jobs:
2019
build:
@@ -44,10 +43,7 @@ jobs:
4443
publish:
4544
needs: build
4645
runs-on: ubuntu-latest
47-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
48-
environment:
49-
name: pypi
50-
url: https://pypi.org/p/durable-workflow
46+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
5147
steps:
5248
- uses: actions/download-artifact@v4
5349
with:
@@ -57,15 +53,13 @@ jobs:
5753
- name: Publish to PyPI
5854
uses: pypa/gh-action-pypi-publish@release/v1
5955
with:
56+
password: ${{ secrets.PYPI_TOKEN }}
6057
print-hash: true
6158

6259
publish-test:
6360
needs: build
6461
runs-on: ubuntu-latest
6562
if: github.event_name == 'workflow_dispatch' && !inputs.dry_run
66-
environment:
67-
name: testpypi
68-
url: https://test.pypi.org/p/durable-workflow
6963
steps:
7064
- uses: actions/download-artifact@v4
7165
with:
@@ -75,5 +69,6 @@ jobs:
7569
- name: Publish to TestPyPI
7670
uses: pypa/gh-action-pypi-publish@release/v1
7771
with:
72+
password: ${{ secrets.TEST_PYPI_TOKEN }}
7873
repository-url: https://test.pypi.org/legacy/
7974
print-hash: true

0 commit comments

Comments
 (0)