ci(release): publish from a tag push instead of a manual dispatch - #32
Merged
Merged
Conversation
A version release is one event: the tag, the five platform builds, the JDK worker, the GitHub Release and the three npm packages. Publishing required a tag push plus `gh workflow run packages.yml --ref vX -f publish=true`, so the second step could be forgotten or run for another ref. Trigger the workflow on `v*` tag pushes as well and let the publish steps run for `github.event_name == 'push'`, keeping `workflow_dispatch` for a dry build without publishing. The existing assertions still gate the release: the tag name must equal the version in the three `package.json` files, the tag must be annotated and point at the checked-out commit, and CI must have succeeded on that commit. A tag push can start while the CI run for the same commit is still going, which previously failed the release immediately. The publish step now waits up to 20 minutes for that CI run and stops early when it has already failed.
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
One version release is one event — the tag, the five platform builds, the JDBC worker jar, the GitHub Release and the three npm packages — but it needed two commands:
packages.ymlwasworkflow_dispatchonly, so a pushed tag built nothing by itself, and the dispatch could be forgotten or aimed at the wrong ref.Change
.github/workflows/packages.yml:push: tags: ["v*"], keepingworkflow_dispatchfor a dry build;Publish releasestep and thenpmjob forgithub.event_name == 'push' || inputs.publish, so a tag push publishes and a manual run still defaults topublish=false.The guards are unchanged, so a tag push cannot publish something unintended:
GITHUB_REF_NAMEmust equal the version in all threepackage.jsonfiles, the tag must be annotated and point at the checked-out commit, andci.ymlmust have succeeded for that commit.A tag push can also start while the CI run for the same commit is still in flight; the old one-shot check failed the release in that window. The publish step now polls for that CI run, up to 20 minutes, and stops early when it has already failed.
After this, a release is one command:
Commands run
Static validation only: the tag-push path itself cannot be exercised without publishing a real version. The guards it depends on (
GITHUB_REF_NAME, tag type, CI status) are the same ones the manual path already used, and GitHub parses the workflow file on this PR.Risk
main.workflow_dispatchwithpublish=falsestill builds and verifies assets without publishing.Review entry points
.github/workflows/packages.yml— theon:block, thePublish releasestep and thenpmjob condition.AI assistance
Prepared with DeepSeek Harness; the two validation commands above were run locally.