Skip to content

Commit a0483c8

Browse files
committed
fix(ci): stop publishing to PyPI through a reusable workflow
PyPI does not accept a reusable workflow as a trusted publisher -- pypi/warehouse#11096, unresolved. Both publish jobs here called reqstool/.github's python-publish-to-pypi.yml via workflow_call, so every real publish attempt failed at the OIDC exchange with invalid-publisher regardless of what the trusted publisher config named -- confirmed today, and it explains why publish-dev-to-testpypi.yml has been failing on every push to main since the 2026-08-16 migration. Switches both jobs to reqstool/.github's new actions/publish-to-pypi composite action, called directly from a job defined in this workflow. A composite action doesn't have the same problem: the OIDC claim is about which workflow file the job runs in, not what its steps reference. The two-index environment derivation (testpypi -> test, pypi -> stable) that the reusable workflow computed internally now has to be explicit per job -- a composite action can't set the caller's environment:. Needs reqstool/.github#92 merged first. Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
1 parent 50323bd commit a0483c8

2 files changed

Lines changed: 26 additions & 11 deletions

File tree

.github/workflows/publish-dev-to-testpypi.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ jobs:
2222

2323
publish-to-test-pypi:
2424
needs: build
25-
uses: reqstool/.github/.github/workflows/python-publish-to-pypi.yml@main
25+
runs-on: ubuntu-latest
26+
environment:
27+
name: test
28+
url: https://test.pypi.org
2629
permissions:
2730
id-token: write
28-
with:
29-
target: testpypi
31+
steps:
32+
- uses: reqstool/.github/.github/actions/publish-to-pypi@main
33+
with:
34+
target: testpypi

.github/workflows/release.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,25 +97,35 @@ jobs:
9797

9898
publish-to-testpypi:
9999
needs: [prepare, assets]
100-
uses: reqstool/.github/.github/workflows/python-publish-to-pypi.yml@main
100+
runs-on: ubuntu-latest
101+
environment:
102+
name: test
103+
url: https://test.pypi.org
101104
permissions:
102105
id-token: write
103-
with:
104-
target: testpypi
105-
artifact: dist-tagged
106+
steps:
107+
- uses: reqstool/.github/.github/actions/publish-to-pypi@main
108+
with:
109+
target: testpypi
110+
artifact: dist-tagged
106111

107112
# PyPI is the only step here that cannot be undone: a version can be yanked but
108113
# never replaced. A release candidate stops at Test PyPI -- pip needs --pre to
109114
# see a prerelease anyway.
110115
publish-to-pypi:
111116
needs: [prepare, publish-to-testpypi]
112117
if: ${{ needs.prepare.outputs.prerelease != 'true' }}
113-
uses: reqstool/.github/.github/workflows/python-publish-to-pypi.yml@main
118+
runs-on: ubuntu-latest
119+
environment:
120+
name: stable
121+
url: https://pypi.org
114122
permissions:
115123
id-token: write
116-
with:
117-
target: pypi
118-
artifact: dist-tagged
124+
steps:
125+
- uses: reqstool/.github/.github/actions/publish-to-pypi@main
126+
with:
127+
target: pypi
128+
artifact: dist-tagged
119129

120130
# Last, deliberately. Everything above can fail, and until this runs nothing
121131
# resolving "the latest release" can see what was built -- the release is still

0 commit comments

Comments
 (0)