Production PyPI upload moves to the caller (Trusted Publishing can't match a reusable workflow) - #53
Merged
Merged
Conversation
… match a reusable workflow PyPI matches a Trusted Publisher against job_workflow_ref, which inside a called workflow is this repository's coordinator at a publishing tag. No repository's publisher can name that, so audiodsp v0.6.1's upload failed with invalid-publisher. The coordinator's publish-to-pypi job becomes pypi-gate, which only decides. The workflow exposes pypi-publish, dist-artifact and version outputs, and the caller runs the upload in its own pypi job. Release Health gets pypi=pending from the coordinator and the outcome from the new reusable-report-pypi-result.yml, which release-health.yml folds into the same row. TestPyPI keeps its token upload in the coordinator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
audiodsp v0.6.1 built and reached TestPyPI, then failed at
publish-to-pypiwithinvalid-publisher(run 36131566669). Its PyPI Trusted Publisher is set up right. The problem is where the upload ran: PyPI matches the publisher againstjob_workflow_ref, the workflow that runs the job, and the log shows that wasPyDevices/.github/.github/workflows/reusable-publish-release-packages.yml@refs/tags/publishing-v8. No repository's publisher can name that (pypa/gh-action-pypi-publish#166, PyPI's note).So the upload moves to the caller. The coordinator's
publish-to-pypijob becomespypi-gate. It makes the same decision (opted in, final release, build and TestPyPI succeeded) and uploads nothing. The workflow exposes three outputs,pypi-publish,dist-artifactandversion, and the caller's ownpypijob (environmentpypi,id-token: write) downloads the artifact and uploads. The caller's side is audiodsp#151.TestPyPI isn't affected. It uses
TESTPYPI_API_TOKEN, not Trusted Publishing, so its upload stays in the coordinator.Release Health keeps its order. The coordinator's report still goes out when its jobs finish, and for a release headed to PyPI it now says
pypi: pending. The caller'sreport-pypijob calls the newreusable-report-pypi-result.ymlonce the upload ends (or is rejected), and that sends a partial report.release-health.ymlfolds it into the same row when the version matches. Three new tests cover that, and the merge test fails when the merge line is removed.Only audiodsp sets
pypi-publish: true. audiocomponents (v8) and palettes, pdwidgets, pygraphics, lvgl-python and mpftp (v6) don't, and pydevices (v11) doesn't either, so nobody else needs a caller change.Order
scripts/cut_publishing_tag.sh 12(or the next free number). That tag also carries .github#52's pydevices publishing changes. Cutting it moves nobody: pydevices and mip stay on v11 until their pins move, so pydevices publishing: own-package MIP packages and PyPI extras (for bledev) #52's own rollout is still for another time.publishing-vNEXTrefs with that tag, then merge it. Until then that PR's publish workflow fails at startup, so don't cut an audiodsp release from it before the refs are real.For audiodsp the jump from v8 to the new tag also brings cibuildwheel 4.2.0 → 4.2.1, setup-java v5 → v6, and sibling refs that name their own tag. Nothing else in its path changes.
v0.6.1 itself won't reach PyPI through this fix. The
pypienvironment only deploys fromv*tags, and a dispatch on thev0.6.1tag runs the caller as it was at that tag. Either the next audiodsp release goes up this way, or youtwine uploadv0.6.1's Release assets by hand, the way 0.6.0 was parked.Checked
actionlint 1.7.12 is clean on every workflow. The caller's jobs were also linted against these reusables resolved locally, and a misspelt output there is caught. The YAML parses. The
sibling-refscheck still sees one tag.ruff check scripts/ tests/passes, and all unit tests pass. Nothing ran on GitHub: no tag, no publish.On this PR,
generator-idempotencyfails, and the cause isn't here. The generator lists pydevices 0.5.4, but themiprepository's published page still says 0.5.3, so the two have drifted since the 0.5.4 release. This PR doesn't touchdata/or the generator. The other five checks pass.