ci(desktop-release): auto-resolve the production version on merge to main - #83
Merged
Merged
Conversation
…merge to main A push to main took desktop/package.json literally: if that version had already shipped, preflight set should_release=false and every build job was skipped, so the merge produced no release at all and nothing failed loudly. package.json sat at 1.0.43 while production was on v1.0.46. Shipping therefore meant committing a bump to develop and merging to main a second time. main now runs the same "bump patch until unreleased" loop develop already used, so a develop -> main merge always ships. An explicit workflow_dispatch version is still taken literally and still skipped when that release exists, so a release number can be pinned by hand. v<x> and the dev prereleases v<x>-dev.<n> are distinct tags and semver sorts the prerelease below the release, so promoting the version the dev channel has been building is correct. A new bump-develop-version job then writes the next patch back into desktop/package.json on develop so the committed number tracks reality. It never moves the version backwards, no-ops when already correct, and rebase-retries if develop moved. It pushes to develop and never main: a bot commit touching desktop/** on main would retrigger this workflow and immediately release the bumped version. Co-Authored-By: Claude Opus 5 <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
A push to
maintookdesktop/package.jsonliterally. If that version had already shipped, preflight setshould_release=false, all three build jobs were skipped, and the merge produced no release at all — silently, with nothing failing.desktop/package.jsonis at 1.0.43 while production is on v1.0.46, so every merge tomainsince 1.0.43 has been a no-op release. Shipping meant committing a version bump todevelopand merging tomaina second time.Changes
1.
mainresolves the version itself (preflight)A push to
mainnow runs the same "bump patch until unreleased" loopdevelopalready had, so a develop→main merge always ships:An explicit
workflow_dispatchversion is still taken literally and still skipped if that release exists, so a number can be pinned by hand.Tags don't collide:
v1.0.47andv1.0.47-dev.2are distinct refs, and semver sorts the prerelease below the release — the same property the dev channel's existing comment relies on. Promoting the version the dev channel has been building is the intended outcome.2. New
bump-develop-versionjobAfter a successful production build, writes the next patch after the shipped version into
desktop/package.jsonondevelop, so the committed number tracks reality instead of drifting.1.1.0on develop is left alone)developmoved mid-rundevelop, nevermain— a bot commit touchingdesktop/**onmainwould retrigger this workflow and immediately release the bumped version.[skip ci]is a second guard; aGITHUB_TOKENpush doesn't trigger workflows anyway.Effect on the next release
Merging
develop→mainreleases v1.0.47 and then setsdevelopto1.0.48. No manual bump commit.Verification
Workflow YAML parses (8 jobs resolve). The backwards-guard comparison was tested against
currentvalues of1.0.43/1.0.48/1.1.0/1.0.47.desktop/package.jsonhas noversion/preversionlifecycle scripts, sonpm version --no-git-tag-versionis a plain file write.🤖 Generated with Claude Code