ci(release): auto-trigger multi-OS build on release-please merge#69
Merged
Conversation
Release-please pushes tags with GITHUB_TOKEN, which cannot trigger tag-based workflows (anti-recursion). release.yml gains a workflow_call trigger (tag + optional ref, since a draft release's tag does not exist yet) and release-please.yml calls it on release_created with the tag and merge SHA — no more manual dispatch. All checkouts pin to ref||tag and build hashes come from `git rev-parse HEAD` of the checkout, so binaries always stamp the commit actually built. The create-release step reuses release-please's draft (keeping its changelog body), deletes only duplicate drafts, retargets a stale draft to the built commit, and creates new drafts with an explicit --target. release-please now creates draft releases (assets attach to the draft; it goes public only once all builds succeed — no partial-asset public release) with force-tag-creation so version computation stays correct even when a build fails.
be41ef5 to
2c278a1
Compare
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
Merging the release-please release PR now produces the FULL release (tag, multi-OS builds, assets, publication) with zero manual steps. Previously every release required
gh workflow run release.yml --field tag=vX.Y.Zby hand, because the tag release-please pushes (with the defaultGITHUB_TOKEN) can never trigger tag-triggered workflows (GitHub anti-recursion rule).release.ymlgains aworkflow_calltrigger (tag+ optionalrefcarrying the exact commit SHA — needed because a draft release's git tag may not exist yet); the existing tag-push and manual-dispatch triggers are kept as fallbacks. All six checkouts pin toref || tag, andTERMORA_BUILD_HASHis now stamped fromgit rev-parse HEADof the checkout instead of the event SHA, so binaries always report the commit actually built.release-please.ymlgains arelease-buildjob that callsrelease.ymlwhenrelease_created == 'true', passingtag_name+ the merge SHA.release-please-config.jsonswitches to draft releases (draft: true): assets attach to the draft and the release goes public only when every build succeeded — a mid-build failure can no longer leave a public release with partial assets.force-tag-creation: truemakes release-please create the git tag immediately (GitHub defers tag creation for drafts), so subsequent release-please runs compute versions/changelogs correctly even if a build fails.create-releasereuses release-please's draft (preserving its curated changelog body), deletes only duplicate drafts, and retargets a stale draft'starget_commitishto the built commit before it can be published.The release flow becomes: merge the release PR → tag + draft release + 3-OS builds + assets → auto-publish. The
workflow_dispatchpath remains available to re-run builds for an existing tag.Test plan
actionlintclean on both workflows (only pre-existing SC2129 style nit on an untouched block)release-please-config.jsonvalid;draft+force-tag-creationconfirmed against the upstream config schemapush: tags,workflow_dispatch,workflow_call); caller permissions (contents: write) cover the callee