[codex] Automate desktop release version sync#5
Merged
Conversation
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.
What this PR does
Adds release-version tooling to the desktop release flow. The manual workflow asks for a desktop app
version, accepts either0.0.2orv0.0.2, normalizes that into package version0.0.2and release tagv0.0.2, and uses the same version across installer builds, GitHub Release publishing, and the version-sync PR.The workflow now bumps desktop package versions inside GitHub Actions. For
dry_run=true, each build job bumps locally and builds installers without pushing a branch or touching GitHub Releases. Fordry_run=false, the workflow requiresmain, createsrelease/desktop-vX.Y.Z, commits the bumped versions, builds from that release ref, publishes the Release against that ref, then creates a version-sync PR back tomainand enables auto-merge.This also adds
bun run bump-desktop-version <version>, which updates the three desktop release version sources together:package.json,apps/electron/package.json, andpackages/shared/package.json. Use--dry-runto preview the changes without writing files.Why it's needed
The installer version comes from the Electron app package metadata, while the runtime-visible version comes from the shared package metadata. Without explicit tooling, a maintainer could type
0.0.2in GitHub Actions while the packaged app still reports0.0.1, or manually bump only one of the package files.Keeping these versions aligned is also the base contract needed before electron auto-update metadata is enabled later. Automating the bump in the release workflow removes the need for a manual pre-release version PR.
Reviewer Test Plan
How to verify
Run
bun run bump-desktop-version --dry-run 0.0.2and confirm it listspackage.json,apps/electron/package.json, andpackages/shared/package.jsonchanging from0.0.1to0.0.2while leaving the working tree unchanged.Run the
Desktop Releaseworkflow from GitHub Actions withversion=0.0.2anddry_run=truefrom this branch; confirm the prepare job bumps and validates the version, the build jobs start from the selected ref and bump locally before packaging, the dry-run summary uses release tagv0.0.2, and no release branch or GitHub Release is created.After this PR lands, run the workflow from
mainwithdry_run=false. Confirm it createsrelease/desktop-vX.Y.Z, publishes the GitHub Release against that release ref, createschore(release): desktop vX.Y.Z, and enables auto-merge for that version-sync PR.Evidence (Before & After)
N/A. This is CI/release automation, not a user-visible UI change.
Tested on
Environment (optional)
Local checks on macOS:
bun run bump-desktop-version --dry-run 0.0.2bun run bump-desktop-version --dry-run v0.0.2bun run bump-desktop-version --dry-run 0.02fails as expected because0.02is not valid SemVerbun run bump-desktop-version 0.0.1bun run check-release-version --version 0.0.1bun run check-release-version --version 0.0.2fails as expected while source versions are still0.0.1ruby -e 'require "yaml"; YAML.load_file(".github/workflows/desktop-release.yml"); puts "YAML OK"'go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/desktop-release.ymlgit diff --checkRisk & Scope
mainwithdry_run=false; the workflow will create and auto-merge the version-sync PR.Linked Issues
N/A
中文说明
What this PR does
给桌面端发布流程增加 release version 工具。手动 workflow 填写的是桌面端 app
version,支持输入0.0.2或v0.0.2,会统一转换成 package version0.0.2和 release tagv0.0.2,并且让安装包构建、GitHub Release 发布、版本同步 PR 都使用同一个版本。workflow 现在会在 GitHub Actions 里自动 bump 桌面端 package 版本。
dry_run=true时,每个 build job 都只在本地 bump 后打安装包,不推分支,也不碰 GitHub Releases。dry_run=false时,workflow 要求从main触发,创建release/desktop-vX.Y.Z,提交 bump 后的版本,从这个 release ref 构建,基于这个 ref 发布 Release,然后自动创建同步回main的版本 PR 并开启 auto-merge。同时新增
bun run bump-desktop-version <version>,一次性更新三个桌面端发布版本源:package.json、apps/electron/package.json、packages/shared/package.json。可以用--dry-run预览改动,不写文件。Why it's needed
安装包版本来自 Electron app package metadata,运行时可见版本来自 shared package metadata。如果没有显式工具,维护者可能在 GitHub Actions 里填了
0.0.2,但最终打出来的 app 仍然显示0.0.1,或者手动 bump 时只改了其中一个 package 文件。保持这些版本一致,也是后续启用 electron 自动更新 metadata 前必须有的基础约定。把 bump 放进 release workflow 后,就不再需要发版前人工提一个版本号 PR。
Reviewer Test Plan
How to verify
运行
bun run bump-desktop-version --dry-run 0.0.2,确认它会列出package.json、apps/electron/package.json、packages/shared/package.json从0.0.1改到0.0.2,但不会改动工作区。在 GitHub Actions 里从这个分支运行
Desktop Releaseworkflow,设置version=0.0.2且dry_run=true;确认 prepare job 会 bump 并校验版本,build jobs 会从所选 ref 开始并在本地 bump 后再打包,dry-run summary 使用 release tagv0.0.2,并且不会创建 release branch 或 GitHub Release。这个 PR 合并后,从
main运行 workflow,并设置dry_run=false。确认它会创建release/desktop-vX.Y.Z,基于这个 release ref 发布 GitHub Release,创建chore(release): desktop vX.Y.Z,并为这个版本同步 PR 开启 auto-merge。Evidence (Before & After)
N/A。这是 CI/release 自动化,不是用户可见 UI 改动。
Tested on
Environment (optional)
macOS 本地检查:
bun run bump-desktop-version --dry-run 0.0.2bun run bump-desktop-version --dry-run v0.0.2bun run bump-desktop-version --dry-run 0.02按预期失败,因为0.02不是合法 SemVerbun run bump-desktop-version 0.0.1bun run check-release-version --version 0.0.1bun run check-release-version --version 0.0.2在源码仍是0.0.1时按预期失败ruby -e 'require "yaml"; YAML.load_file(".github/workflows/desktop-release.yml"); puts "YAML OK"'go run github.com/rhysd/actionlint/cmd/actionlint@latest .github/workflows/desktop-release.ymlgit diff --checkRisk & Scope
main运行 workflow,并设置dry_run=false;workflow 会自动创建并 auto-merge 版本同步 PR。Linked Issues
N/A