chore: trigger PyPI publish workflow after creating a release#4667
Open
dbrattli wants to merge 1 commit into
Open
chore: trigger PyPI publish workflow after creating a release#4667dbrattli wants to merge 1 commit into
dbrattli wants to merge 1 commit into
Conversation
The GitHub release is created with `gh release create` authenticated via the default GITHUB_TOKEN. GitHub deliberately suppresses the `release: published` event from triggering other workflows in that case (to avoid recursive runs), so publish-pypi.yml never ran automatically. Explicitly dispatch publish-pypi.yml for the freshly created tag. `workflow_dispatch` is one of the two events that CAN be triggered by GITHUB_TOKEN, so this needs no additional secret. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The automated release flow (EasyBuild ShipIt) creates a GitHub release but does not trigger
publish-pypi.yml, so the PyPI publish had to be dispatched manually.Root cause
publish-pypi.ymllistens forrelease: types: [published]. The release is created withgh release create(GithubRelease.fs), authenticated in CI via the defaultGITHUB_TOKEN. GitHub deliberately suppresses events triggered byGITHUB_TOKENfrom starting other workflow runs (to prevent recursive runs) — exceptworkflow_dispatchandrepository_dispatch. So therelease: publishedevent fires but is silently ignored by downstream workflows.Fix
After a release is created, explicitly dispatch
publish-pypi.ymlfor the freshly created tag viagh workflow run publish-pypi.yml --ref <tag>. Sinceworkflow_dispatchis one of the two events that can be triggered byGITHUB_TOKEN, this works with the token already present in the workflow — no new PAT/secret needed.The call sits inside the existing
if not releaseExistsguard, so it only fires for genuinely new releases, and dispatches against the new tag sodunamai --latest-tagresolves the correct version. No changes topublish-pypi.ymlare required (it already hasworkflow_dispatch).Note: a local
./build.sh github-releasewill now also dispatch the PyPI workflow when it creates a release, which is consistent with creating a release meaning "publish all packages".🤖 Generated with Claude Code