finish-release
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePre-operation Checks
操作前检查
Verify working tree is clean and current branch matches per .
release/*${CLAUDE_PLUGIN_ROOT}/references/invariants.md确认工作区干净,且当前分支符合格式,参考。
release/*${CLAUDE_PLUGIN_ROOT}/references/invariants.mdPhase 1: Identify Version
阶段1:确定版本号
Goal: Determine release version from current branch or argument.
Actions:
- If provided, use it as version (strip 'v' prefix if present)
$ARGUMENTS - Otherwise, extract from current branch: (strip
git branch --show-currentprefix)release/ - Store clean version without 'v' prefix (e.g., "1.0.0")
目标:从当前分支或参数中确定发布版本号。
操作步骤:
- 如果提供了,将其作为版本号(如果有'v'前缀则去除)
$ARGUMENTS - 否则,从当前分支提取版本号:执行(去除
git branch --show-current前缀)release/ - 存储不带'v'前缀的干净版本号(例如:"1.0.0")
Phase 2: Pre-finish Checks
阶段2:完成前检查
Goal: Run tests before finishing.
Actions:
- Identify test commands (check package.json, Makefile, etc.)
- Run tests if available; exit if tests fail
目标:在完成发布前运行测试。
操作步骤:
- 确定测试命令(检查package.json、Makefile等文件)
- 如果有可用测试则运行;若测试失败则退出流程
Phase 3: Update Changelog
阶段3:更新变更日志
Goal: Generate changelog from commits.
Actions:
- Get previous tag:
git tag --sort=-v:refname | head -1 - Collect commits per
${CLAUDE_PLUGIN_ROOT}/references/changelog-generation.md - Update CHANGELOG.md per
${CLAUDE_PLUGIN_ROOT}/examples/changelog.md - Commit: with
chore: update changelog for v$VERSIONfooterCo-Authored-By
目标:从提交记录生成变更日志。
操作步骤:
- 获取上一个标签:执行
git tag --sort=-v:refname | head -1 - 参考收集提交记录
${CLAUDE_PLUGIN_ROOT}/references/changelog-generation.md - 参考更新CHANGELOG.md文件
${CLAUDE_PLUGIN_ROOT}/examples/changelog.md - 提交变更:使用作为提交信息,并添加
chore: update changelog for v$VERSION脚注Co-Authored-By
Phase 4: Finish Release
阶段4:完成版本发布
Goal: Complete release using git-flow-next CLI.
Actions:
- Run
git flow release finish $VERSION --tagname "v$VERSION" -m "Release v$VERSION" - Verify current branch: (should be on develop)
git branch --show-current - Push all:
git push origin main develop --tags
目标:使用git-flow-next CLI完成发布流程。
操作步骤:
- 执行
git flow release finish $VERSION --tagname "v$VERSION" -m "Release v$VERSION" - 确认当前分支:执行(应处于develop分支)
git branch --show-current - 推送所有内容:执行
git push origin main develop --tags
Phase 5: GitHub Release
阶段5:创建GitHub发布
Goal: Create GitHub release from existing tag.
Actions:
- Extract changelog for this version from CHANGELOG.md
- Run
gh release create "v$VERSION" --title "v$VERSION" --notes "<changelog>" --verify-tag
目标:基于现有标签创建GitHub发布。
操作步骤:
- 从CHANGELOG.md中提取该版本的变更日志内容
- 执行
gh release create "v$VERSION" --title "v$VERSION" --notes "<changelog>" --verify-tag