Skip to content

ci(desktop-release): auto-resolve the production version on merge to main - #83

Merged
bladehell-ai merged 1 commit into
developfrom
chore/auto-bump-desktop-version-on-release
Aug 21, 2026
Merged

ci(desktop-release): auto-resolve the production version on merge to main#83
bladehell-ai merged 1 commit into
developfrom
chore/auto-bump-desktop-version-on-release

Conversation

@bladehell-ai

Copy link
Copy Markdown
Collaborator

Problem

A push to main took desktop/package.json literally. If that version had already shipped, preflight set should_release=false, all three build jobs were skipped, and the merge produced no release at all — silently, with nothing failing.

desktop/package.json is at 1.0.43 while production is on v1.0.46, so every merge to main since 1.0.43 has been a no-op release. Shipping meant committing a version bump to develop and merging to main a second time.

Changes

1. main resolves the version itself (preflight)

A push to main now runs the same "bump patch until unreleased" loop develop already had, so a develop→main merge always ships:

BASE=1.0.43 → v1.0.43 shipped → 1.0.44 → … → 1.0.47 unreleased → release v1.0.47

An explicit workflow_dispatch version 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.47 and v1.0.47-dev.2 are 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-version job

After a successful production build, writes the next patch after the shipped version into desktop/package.json on develop, so the committed number tracks reality instead of drifting.

  • Never moves the version backwards (a hand-set 1.1.0 on develop is left alone)
  • No-ops when already correct
  • Rebase-retries if develop moved mid-run
  • Pushes to develop, never main — a bot commit touching desktop/** on main would retrigger this workflow and immediately release the bumped version. [skip ci] is a second guard; a GITHUB_TOKEN push doesn't trigger workflows anyway.

Effect on the next release

Merging developmain releases v1.0.47 and then sets develop to 1.0.48. No manual bump commit.

Verification

Workflow YAML parses (8 jobs resolve). The backwards-guard comparison was tested against current values of 1.0.43 / 1.0.48 / 1.1.0 / 1.0.47. desktop/package.json has no version/preversion lifecycle scripts, so npm version --no-git-tag-version is a plain file write.

🤖 Generated with Claude Code

…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>
@bladehell-ai
bladehell-ai merged commit b1ce634 into develop Aug 21, 2026
5 checks passed
@bladehell-ai
bladehell-ai deleted the chore/auto-bump-desktop-version-on-release branch August 21, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant