| name | release-patch |
| std-agent-type | commands |
| description | 走 stdagent 标准化 patch 发版流程(CI 验证 -> tag -> goreleaser -> 验收) (Invoke when user types /release-patch or asks to run release-patch) |
/release-patch
发一个 patch 版本(v0.0.X -> v0.0.X+1)。流程:
1. 前置检查
git status
git log origin/main..HEAD
gh run list --branch main --limit 1
2. 确定版本号
git tag --sort=-v:refname | head -1
得到当前最新 tag,自动 +1(仅 patch)。例如:v0.0.3 -> v0.0.4。
3. 打 tag 并 push
NEXT=v0.0.4
git tag -a "$NEXT" -m "release $NEXT"
git push origin "$NEXT"
push tag 会触发 .github/workflows/release.yml(goreleaser),自动:
- 跨平台构建(darwin/linux/windows × amd64/arm64)
- 生成 sha256 校验
- 发 GitHub Release(含 CHANGELOG_LATEST.md 内容)
4. 验收
gh release view "$NEXT"
gh run list --workflow=release.yml --limit 1
确认:
- Release 页面有 assets(每平台 .tar.gz / .zip + checksums.txt)
- install.sh 能拉到新版本:
curl -fsSL https://raw.githubusercontent.com/StringKe/std-agent/main/install.sh | sh
./bin/stdagent version 显示新版本号
5. 不要做的事
- 不在已推送 commit 上 amend / rebase(HARD RULE)
- tag 一旦 push 不要删(goreleaser 已触发即不可撤回,要修发更高 patch 覆盖)
- 跳过 CI 直接打 tag(应当先验证 CI 全绿)
异常处理
- CI fail 在 main:先修 fail commit 再发版(不要带着已知 fail 打 tag)
- goreleaser fail 但 tag 已 push:在 GitHub Actions 重跑 release.yml;仍 fail 就发更高 patch
- 已有 release 但要补内容:发更高 patch(v0.0.X+1),不要修旧 release