infra: collapse release + publish into one atomic workflow#30
Merged
Conversation
The previous two-workflow split (release.yml tags, publish.yml publishes on tag push) had a fatal gap: tag pushes by GITHUB_TOKEN do not trigger downstream workflows (GitHub's anti-cascade guard). So v3.1.1 got tagged but never reached PyPI. New release.yml does everything in one job: read __version__ → build → twine check → OIDC publish to PyPI → tag and push. Publish happens before tag push, so a failed publish leaves no orphan tag — re-runs are idempotent. publish.yml deleted (superseded).
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.
Summary
The previous two-workflow split —
release.yml(tag) +publish.yml(build/publish on tag push) — had a fatal gap: tag pushes byGITHUB_TOKENdo not trigger downstream workflows. That's GitHub's anti-cascade guard. So our v3.1.1 release tagged on origin butpublish.ymlnever fired, and PyPI is still at 3.1.0.This PR consolidates everything into one workflow that does, in order:
__version__fromsrc/canopy/__init__.pyvN.N.Nalready exists (prevents accidental re-release at same version)python -m build+twine checkvN.N.NtagPublish happens before tag push, so a failed PyPI publish leaves no orphan tag — re-runs work cleanly.
publish.ymldeleted.Why this avoids the cascade limitation
There's no second workflow to trigger. The dispatch action does everything itself, end-to-end. The OIDC trusted-publisher setup (already configured) handles auth; no PAT needed.
Cleanup before this is useful
The current orphan
v3.1.1tag on origin will block the new workflow's "tag already exists" check. After merge: delete the orphan tag locally and on origin, then run "Release (build + publish + tag)" from the Actions UI. The new run will re-create v3.1.1 cleanly and ship it to PyPI.Test plan
v3.1.1tag exists on origin