Skip to content

fix(ci): stop publishing to PyPI through a reusable workflow - #139

Merged
jimisola merged 4 commits into
mainfrom
fix/pypi-trusted-publishing-composite-action
Aug 23, 2026
Merged

fix(ci): stop publishing to PyPI through a reusable workflow#139
jimisola merged 4 commits into
mainfrom
fix/pypi-trusted-publishing-composite-action

Conversation

@jimisola

@jimisola jimisola commented Aug 23, 2026

Copy link
Copy Markdown
Member

Description

Companion to reqstool/.github#92 — that PR
adds the actions/publish-to-pypi composite action, this one stops calling the reusable
workflow it replaces, and drops Test PyPI entirely.

PyPI does not accept a reusable workflow as a trusted publisher —
pypi/warehouse#11096, unresolved. Both
publish-to-testpypi/publish-to-pypi in release.yml and publish-to-test-pypi in
publish-dev-to-testpypi.yml called 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 on pypi.org named. Confirmed today from a real release
run, and it's the reason publish-dev-to-testpypi.yml has been failing on every push to
main since the 2026-08-16 migration
— a week of silent failures on the dev feed.

What changes

  • publish-to-pypi now calls reqstool/.github's new actions/publish-to-pypi — a
    composite action, not a workflow_call workflow — directly from a job defined in this
    repo's own workflow file. That satisfies PyPI's requirement: the OIDC claim is about which
    workflow file the job runs in, not what its steps reference.
  • Test PyPI is gone, not fixed. PyPI accepts a pre-release version identifier
    (0.3.0rc1) on the real index directly, and pip ignores it without --pre — there was
    never a need to route a release candidate to a separate staging index to hold it safely.
    So publish-to-testpypi is deleted rather than repaired, publish-to-pypi runs
    unconditionally instead of skipping for a release candidate (this also makes it consistent
    with what npm and Maven Central already do here), and publish-dev-to-testpypi.yml — the
    continuous dev feed to Test PyPI on every push to main — is deleted outright, since
    there's nowhere left for it to publish to.

Needs reqstool/.github#92 merged firstactions/publish-to-pypi@main doesn't exist
until then.

Checklist

Test plan

YAML validated locally. The real test is a dispatch once reqstool/.github#92 is merged: a
real release run reaching publish-to-pypi (this is what failed before — see
reqstool/.github#92's description for the failed run), including once with prerelease: rc
to confirm a candidate now publishes to the real index rather than being silently skipped.

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>
Comment thread .github/workflows/publish-dev-to-testpypi.yml Fixed
Comment thread .github/workflows/release.yml Fixed
Comment thread .github/workflows/release.yml Fixed
PyPI accepts a pre-release version identifier (0.3.0rc1) on the real
index directly, and pip ignores it without --pre -- there was never a
need to route a release candidate to a separate staging index to hold
it safely. Test PyPI existed here only as that safety net.

publish-to-pypi now runs unconditionally instead of skipping for a
release candidate, which also makes this consistent with what npm and
Maven Central already do. publish-dev-to-testpypi.yml is deleted --
it's been failing on every push to main since the 2026-08-16 migration
anyway (see reqstool/.github#92), and there's nowhere left for it to
publish to.

Needs reqstool/.github#92 merged first.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Comment thread .github/workflows/release.yml Fixed
CodeQL flagged actions/unpinned-tag: @main is a mutable ref, so a
compromised or force-pushed reqstool/.github main would execute
through this reference with no review. Pinned to the commit main
pointed at when this action was added, matching the org's existing
`@<sha> # main YYYY-MM-DD` convention for third-party/internal action
references elsewhere in this repo.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
@jimisola
jimisola merged commit 010ea85 into main Aug 23, 2026
10 checks passed
@jimisola
jimisola deleted the fix/pypi-trusted-publishing-composite-action branch August 23, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants