Repository navigation
Prepare, Tag and Publish Releases on Release Branches - #129
Conversation
…ches prepare-release and tag-release take a `branch` input (default master). A release branch takes only its own line's versions, and master refuses a line that already has one. Master's cmake-version.py validates the inputs and reads the target branch from a separate refs/heads/ checkout, so no target-branch code runs. tag-release also refuses a branch without a pull_request rule. release.yaml accepts a tag on master or its version's release branch, and gives the latest label to the highest published stable version. PRs into release/* run the master checks. Adds unit tests for cmake-version.py in a new release-tooling job. Change-Id: If95aa740208950352ead33f612e6e01659f7693e
A forward merge from a release branch can carry that branch's version into the target without a conflict when each side changed different VERSION_* lines: master at 1.2.0-dev merged with release/1.1 going 1.1.0-dev to 1.1.0 becomes 1.2.0. cmake-version.py check-pr compares a PR's merge result with its base and passes a changed version only from that version's release/prep-v<version> branch, onto a branch that may carry it. release-tooling runs it on every PR, and Prepare Release takes the prep branch name from the parser's new prep-branch mode. read and write refuse more than one set(VERSION_*) line, so a tree with unresolved conflict markers fails instead of reporting one side's version. docs/release-workflow.md documents forwarding a release branch's PRs to master, and cutting a release branch once master holds what the line ships.
|
Reviewed current head [P2 / Medium] Serialize Concurrency is scoped per tag, so different versions can publish simultaneously. If Validation: all 33 Python tests passed; actionlint passed for all five changed workflows. |
After a stable release, the branch it shipped from is post-bumped: master to its next -dev version, a release branch to its next patch's (1.1.0 to 1.1.1-dev). The docs and the Prepare Release comments say so. cmake-version.py gains highest-tag, which prints the highest release tag in a version's <major>.<minor> line or an older one, ordering versions numerically and skipping tags outside the grammar. wire-sysio's tag build picks its wire-cdt release with it, and the parser stays identical in both repos.
Publish Release's concurrency group is per tag, so two releases publishing together could each choose the latest label from a release list the other was about to change, leaving it on the lower version. The per-tag job, renamed attach-assets, verifies and uploads the assets, and on the hand-pushed-tag fallback creates the draft itself. Publishing and the label move to a publish-release job whose concurrency group is shared by every tag, with queue: max so each waiting release publishes in turn instead of replacing the one queued before it.
|
Thanks, fixed in 71fe87a. The per-tag job is now actionlint, including its latest release 1.7.12, still rejects |
huangminghuang
left a comment
There was a problem hiding this comment.
Reviewed 71fe87a. No new actionable findings. The previously reported latest-label race is addressed by the shared publishing queue. All 41 parser tests and five mocked publication scenarios passed.
Lets a
release/<major>.<minor>branch carry its own releases (1.1.0-rc1,1.1.0,1.1.1, …) while master moves on. Until nowprepare-release.yamlandtag-release.yamlonly worked on master,release.yamlrefused any tag not on master, and PRs into any other branch ran no checks.prepare-release.yamlandtag-release.yamltake abranchinput, defaultmaster. A release branch takes only its own line's versions, and master refuses a version whoserelease/<major>.<minor>branch already exists.cmake-version.pyvalidates the inputs and reads or writes the target branch, which is checked out asrefs/heads/<branch>intotarget/(without credentials intag-release.yaml). No code from the target branch runs.tag-release.yamlrefuses a branch whose rules have nopull_requestrule.prepare-release.yamlrefuses to force-push a prep branch whose open PR targets another branch.release.yamlaccepts a tag that sits on master or on its version'srelease/<major>.<minor>branch. The branch name is derived inline, because the job runs the tag's own copy of the parser.release.yamlgives thelatestlabel to the highest published stable version, and hands it back if a hand-published older release took it. Publishing and the label run in apublish-releasejob queued across every tag, so releases published together cannot leave the label on the lower version.release/*run the same checks as PRs into master, andrelease/prep-*pushes build nothing.release-toolingjob, whichAll Required Tests Passedwaits for, runs the unit tests forcmake-version.pyin.github/scripts/test_cmake_version.py. It also fails a PR that changes its base branch's version, unless it is that version'srelease/prep-v<version>bump PR onto a branch that may carry it. Without that, mergingrelease/1.1forward into master can carryrelease/1.1's version with no conflict: master at1.2.0-devplusrelease/1.1going1.1.0-devto1.1.0gives master1.2.0.cmake-version.pyrefuses aCMakeLists.txtwith more than oneset(VERSION_*)line, so unresolved conflict markers fail instead of reading as one side's version. It also names the bump branch for bothprepare-release.yamland the PR check, and has thehighest-tagmode wire-sysio's tag build uses to pick its wire-cdt release.docs/release-workflow.mddocuments release branches, how a PR into one is merged forward to master, and the post-bump after a stable release: master to its next-devversion, a release branch to its next patch's (1.1.0to1.1.1-dev).Before the first release from
release/1.1:release/*needs the same branch ruleset as master, excludingrelease/prep-*. Until thentag-release.yamlrefuses the branch.release/1.1from master once this merges and master holds what 1.1 ships (the early cut was deleted), so it carries these workflow files.wire-sysio gets the same change in its own PR.