version-release
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVersion Release Workflow
版本发布工作流
Overview
概述
The primary development branch is canary. All day-to-day development happens on canary. When releasing, canary is merged into main. After merge, automatically handles tagging, version bumping, creating a GitHub Release, and syncing back to the canary branch.
auto-tag-release.ymlOnly two release types are used in practice (major releases are extremely rare and can be ignored):
| Type | Use Case | Frequency | Source Branch | PR Title Format | Version |
|---|---|---|---|---|---|
| Minor | Feature iteration release | ~Every 4 weeks | canary | | Manually set |
| Patch | Weekly release / hotfix / model / DB migration | ~Weekly or as needed | canary or main | Custom (e.g. | Auto patch +1 |
主开发分支为canary。日常开发工作均在canary分支进行。发布时,将canary分支合并至main分支。合并完成后,会自动处理标签创建、版本号更新、GitHub Release创建,以及将变更同步回canary分支。
auto-tag-release.yml实际使用中仅涉及两种发布类型(主版本发布极为罕见,可忽略):
| 类型 | 适用场景 | 频率 | 源分支 | PR标题格式 | 版本号规则 |
|---|---|---|---|---|---|
| Minor | 功能迭代发布 | 约每4周一次 | canary | | 手动指定 |
| Patch | 每周发布/热修复/模型/数据库迁移 | 每周或按需进行 | canary或main | 自定义(如 | 自动补丁号+1 |
Minor Release Workflow
Minor Release工作流
Used to publish a new minor version (e.g. v2.2.0), roughly every 4 weeks.
用于发布新的次要版本(如v2.2.0),大约每4周进行一次。
Steps
步骤
- Create a release branch from canary
bash
git checkout canary
git pull origin canary
git checkout -b release/v{version}
git push -u origin release/v{version}-
Determine the version number — Read the current version fromand compute the next minor version (e.g. 2.1.x → 2.2.0)
package.json -
Create a PR to main
bash
gh pr create \
--title "🚀 release: v{version}" \
--base main \
--head release/v{version} \
--body "## 📦 Release v{version} ..."[!IMPORTANT]: The PR title must strictly match theformat. CI uses a regex on this title to determine the exact version number.🚀 release: v{x.y.z}
- Automatic trigger after merge: auto-tag-release detects the title format and uses the version number from the title to complete the release.
- 从canary分支创建发布分支
bash
git checkout canary
git pull origin canary
git checkout -b release/v{version}
git push -u origin release/v{version}-
确定版本号 — 从读取当前版本,计算下一个次要版本(如2.1.x → 2.2.0)
package.json -
创建合并至main分支的PR
bash
gh pr create \
--title "🚀 release: v{version}" \
--base main \
--head release/v{version} \
--body "## 📦 Release v{version} ..."[!IMPORTANT]: PR标题必须严格符合格式。CI会通过正则匹配该标题来确定具体版本号。🚀 release: v{x.y.z}
- 合并后自动触发:auto-tag-release会识别标题格式,并使用标题中的版本号完成发布流程。
Scripts
脚本
bash
bun run release:branch # Interactive
bun run release:branch --minor # Directly specify minorbash
bun run release:branch # 交互式创建
bun run release:branch --minor # 直接指定次要版本Patch Release Workflow
Patch Release工作流
Version number is automatically bumped by patch +1. There are 4 common scenarios:
| Scenario | Source Branch | Branch Naming | Description |
|---|---|---|---|
| Weekly Release | canary | | Weekly release train, canary → main |
| Bug Hotfix | main | | Emergency bug fix |
| New Model Launch | canary | Community PR merged directly | New model launch, triggered by PR title prefix |
| DB Schema Migration | canary | | Database migration, requires dedicated changelog |
All scenarios auto-bump patch +1. Patch PR titles do not need a version number. See for detailed steps per scenario.
reference/patch-release-scenarios.md版本号会自动进行补丁号+1更新。常见场景分为4种:
| 场景 | 源分支 | 分支命名规则 | 描述 |
|---|---|---|---|
| 每周发布 | canary | | 每周例行发布,将canary合并至main分支 |
| 漏洞热修复 | main | | 紧急漏洞修复 |
| 新模型上线 | canary | 社区PR直接合并 | 新模型上线,通过PR标题前缀自动触发 |
| 数据库Schema迁移 | canary | | 数据库迁移,需编写专用变更日志 |
所有场景均会自动将补丁号+1。Patch Release的PR标题无需包含版本号。各场景的详细步骤请参考。
reference/patch-release-scenarios.mdScripts
脚本
bash
bun run hotfix:branch # Hotfix scenariobash
bun run hotfix:branch # 热修复场景专用Auto-Release Trigger Rules (auto-tag-release.yml)
自动发布触发规则(auto-tag-release.yml)
After a PR is merged into main, CI determines whether to release based on the following priority:
当PR合并至main分支后,CI会根据以下优先级判断是否触发发布:
1. Minor Release (Exact Version)
1. Minor Release(指定版本)
PR title matches → uses the version number from the title.
🚀 release: v{x.y.z}PR标题匹配 → 使用标题中的版本号进行发布。
🚀 release: v{x.y.z}2. Patch Release (Auto patch +1)
2. Patch Release(自动补丁号+1)
Triggered by the following priority:
- Branch name match: or
hotfix/*→ triggers directly (skips title detection)release/* - Title prefix match: PRs with the following title prefixes will trigger:
- /
style💄 style - /
feat✨ feat - /
fix🐛 fix - /
refactor♻️ refactor - /
hotfix/🐛 hotfix🩹 hotfix - /
build👷 build
按以下优先级触发:
- 分支名称匹配:或
hotfix/*→ 直接触发(跳过标题检测)release/* - 标题前缀匹配:包含以下前缀的PR会触发发布:
- /
style💄 style - /
feat✨ feat - /
fix🐛 fix - /
refactor♻️ refactor - /
hotfix/🐛 hotfix🩹 hotfix - /
build👷 build
3. No Trigger
3. 不触发发布
PRs that don't match any of the above conditions (e.g. , , , prefixes) will not trigger a release when merged into main.
docschorecitest不符合上述任何条件的PR(如标题前缀为、、、),合并至main分支时不会触发发布。
docschorecitestPost-Release Automated Actions
发布后自动操作
- Bump package.json — commits
🔖 chore(release): release version v{x.y.z} [skip ci] - Create annotated tag —
v{x.y.z} - Create GitHub Release
- Dispatch sync-main-to-canary — syncs main back to the canary branch
- 更新package.json版本号 — 提交
🔖 chore(release): release version v{x.y.z} [skip ci] - 创建带注释的标签 —
v{x.y.z} - 创建GitHub Release
- 触发sync-main-to-canary任务 — 将main分支的变更同步回canary分支
Claude Action Guide
Claude操作指南
When the user requests a release:
当用户请求发布时:
Minor Release
Minor Release
- Read to get the current version and compute the next minor version
package.json - Create a branch from canary
release/v{version} - Push and create a PR — title must be
🚀 release: v{version} - Inform the user that merging the PR will automatically trigger the release
- 读取获取当前版本,计算下一个次要版本
package.json - 从canary分支创建分支
release/v{version} - 推送分支并创建PR — 标题必须为
🚀 release: v{version} - 告知用户:合并该PR后会自动触发发布流程
Patch Release
Patch Release
Choose the appropriate workflow based on the scenario (see ):
reference/patch-release-scenarios.md- Weekly Release: Create a branch from canary, scan
release/weekly-{YYYYMMDD}to write the changelog, title likegit log main..canary🚀 release: 20260222 - Bug Hotfix: Create a branch from main, use a gitmoji prefix title (e.g.
hotfix/)🐛 fix: ... - New Model Launch: Community PRs trigger automatically via title prefix (/
feat), no extra steps neededstyle - DB Migration: Create a branch from canary, write a dedicated migration changelog
release/db-migration-{name}
根据场景选择对应的工作流(参考):
reference/patch-release-scenarios.md- 每周发布:从canary分支创建分支,通过
release/weekly-{YYYYMMDD}生成变更日志,标题格式如git log main..canary🚀 release: 20260222 - 漏洞热修复:从main分支创建前缀的分支,标题使用gitmoji前缀(如
hotfix/)🐛 fix: ... - 新模型上线:社区PR会通过标题前缀(/
feat)自动触发发布,无需额外操作style - 数据库迁移:从canary分支创建分支,编写专用的迁移变更日志
release/db-migration-{name}
Important Notes
重要注意事项
- Do NOT manually modify the version in package.json — CI will auto-bump it
- Do NOT manually create tags — CI will create them automatically
- The Minor Release PR title format is a hard requirement — incorrect format will not use the specified version number
- Patch PRs do not need a version number — CI auto-bumps patch +1
- All release PRs must include a user-facing changelog
- 请勿手动修改package.json中的版本号 — CI会自动完成版本更新
- 请勿手动创建标签 — CI会自动生成标签
- Minor Release的PR标题格式为硬性要求 — 格式错误将无法使用指定的版本号
- Patch Release的PR无需包含版本号 — CI会自动将补丁号+1
- 所有发布PR必须包含面向用户的变更日志
Changelog Writing Guidelines
变更日志编写规范
All release PR bodies (both Minor and Patch) must include a user-facing changelog. Scan changes via or , then write following the format below.
git log main..canary --onelinegit diff main...canary --stat所有发布PR的描述部分(Minor和Patch均需)必须包含面向用户的变更日志。可通过或扫描变更内容,然后按照以下格式编写。
git log main..canary --onelinegit diff main...canary --statFormat Reference
格式参考
- Weekly Release: See
reference/changelog-example/weekly-release.md - DB Migration: See
reference/changelog-example/db-migration.md
- 每周发布:参考
reference/changelog-example/weekly-release.md - 数据库迁移:参考
reference/changelog-example/db-migration.md
Writing Tips
编写技巧
- User-facing: Describe changes that users can perceive, not internal implementation details
- Clear categories: Group by features, models/providers, desktop, stability/fixes, etc.
- Highlight key items: Use for important feature names
**bold** - Credit contributors: Collect all committers via and list alphabetically
git log - Flexible categories: Choose categories based on actual changes — no need to force-fit all categories
- 面向用户:描述用户可感知的变更,而非内部实现细节
- 分类清晰:按功能、模型/服务商、桌面端、稳定性/修复等维度分组
- 突出重点:使用标注重要功能名称
**加粗** - 感谢贡献者:通过收集所有提交者,按字母顺序列出
git log - 灵活分类:根据实际变更选择分类,无需强行套用所有类别