build(release): 修复发布说明类型映射

- 修复 release-notes-generator 的 Conventional Commits 类型映射

- 补充 SEMREL-RP-006 的验证结果与 PR review 恢复点
This commit is contained in:
gewuyou 2026-05-04 08:14:41 +08:00
parent 53f8baf2ef
commit c5ca161cb5
3 changed files with 79 additions and 5 deletions

View File

@ -78,6 +78,45 @@
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "perf",
"section": "Performance Improvements",
"hidden": false
},
{
"type": "refactor",
"section": "Refactoring",
"hidden": false
},
{
"type": "deps",
"section": "Dependency Updates",
"hidden": false
},
{
"type": "security",
"section": "Security Fixes",
"hidden": false
},
{
"type": "revert",
"section": "Reverts",
"hidden": false
}
]
},
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",

View File

@ -13,10 +13,11 @@
## 当前恢复点
- 恢复点编号SEMREL-RP-005
- 当前阶段:扩展 patch 级提交类型规则
- 恢复点编号SEMREL-RP-006
- 当前阶段:处理 PR review 中的 release notes 类型映射漂移
- 当前焦点:
- `.releaserc.json` 增加 `deps -> patch``security -> patch`
- `.releaserc.json``release-notes-generator` 增加 `presetConfig.types`
- 让 `refactor``deps``security` 这类 patch 级发布原因出现在 semantic-release 生成的 notes 中
- `AGENTS.md``docs/zh-CN/contributing.md` 同步提交类型说明
- `build/semantic-release-rules` 分支映射到当前 active topic
@ -26,7 +27,8 @@
- `semantic-release` preview 虽然不会真实推送 tag但仍会执行远端 `git push --dry-run` 权限探测;如果 PAT 仅具备
read 权限、没有 `contents:write`,仍然会先于版本分析阶段失败
- `semantic-release` 的版本判断完全依赖 Conventional Commits不规范提交会直接影响版本计算
- `deps``security` 的发布语义需要同时维护在 `.releaserc.json``AGENTS.md` 和公开贡献文档中,避免规则漂移
- patch 级提交类型的发布语义需要同时维护在 `.releaserc.json``AGENTS.md`、公开贡献文档和
`release-notes-generator` 的 notes 类型映射中,避免版本升级原因与 workflow summary 漂移
- `cycjimmy/semantic-release-action@v6` 需要在 preview / release 两端都安装 `conventional-changelog-conventionalcommits`
以保证 `conventionalcommits` preset 在 GitHub Actions 中可解析
- `git-cliff-action``OUTPUT` 文件需要在 `softprops/action-gh-release` 执行时保留在当前工作目录,后续如调整
@ -42,6 +44,8 @@
- 已为 PAT 校验的 `mktemp` 文件补充 `trap` 清理,避免异常退出时遗留临时文件路径干扰日志
- `SEMREL-RP-004` 的 release notes 模板修复、验证和合并后分支收尾已归档到
`ai-plan/public/semantic-release-versioning/archive/todos/semantic-release-versioning-rp004-2026-05-02.md`
- `SEMREL-RP-005` 已扩展 `deps` / `security` 的 patch 发布规则,并同步提交规范文档
- `SEMREL-RP-006` 已根据 PR review 复核结果补齐 release notes 类型映射,避免 patch 发布原因只触发版本而不进入 notes
## 验证
@ -51,10 +55,15 @@
- `semantic-release --dry-run --no-ci` 已成功加载 `commit-analyzer``release-notes-generator`,随后因远端 tag
fetch 会 clobber 本地既有 tags 而终止,未暴露配置解析错误
- `dotnet build GFramework.sln -c Release` 通过,`0 warning / 0 error`
- `SEMREL-RP-006` 已完成本地验证:
- `jq . .releaserc.json` 通过
- `semantic-release --dry-run --no-ci` 已成功加载 `commit-analyzer``release-notes-generator`,随后因远端 tag
fetch 会 clobber 本地既有 tags 而终止,未暴露 `presetConfig.types` 配置解析错误
- `dotnet build GFramework.sln -c Release` 通过,`0 warning / 0 error`
- 更早阶段的 dry-run / tag /抽象项目验证已归档到
`ai-plan/public/semantic-release-versioning/archive/todos/semantic-release-versioning-2026-04-26.md`
## 下一步
1. 将本轮规则扩展与跟踪文档更新提交到 `build/semantic-release-rules`
1. 提交 `SEMREL-RP-006` 的 PR review 修复
2. 如后续需要完整 semantic-release 版本预览,先处理本地 tag 与远端 tag 的 clobber 冲突

View File

@ -1,5 +1,31 @@
# Semantic Release 版本迁移追踪
## 2026-05-04
### PR review notes 类型映射修复SEMREL-RP-006
- 通过 `$gframework-pr-review` 抓取当前分支 PR #319
- CodeRabbit 在最新 review body 中提出 1 个 nitpick指出 `deps` / `security` 已触发 patch
`release-notes-generator` 缺少 `presetConfig.types`workflow summary 可能看不到对应发布原因
- 最新 head commit 没有未解决 review threads
- CTRF 测试报告显示 `2264 passed / 0 failed`
- 未找到 MegaLinter 明细块
- 本地复核结论:
- `.releaserc.json``commit-analyzer` 已配置 `deps -> patch``security -> patch`
- `release-notes-generator` 仍只配置 `conventionalcommits` preset 和 `parserOpts.noteKeywords`
- 该 drift 会让 patch 级发布原因与 release notes 可读性不一致,评论成立
- 已应用修复:
- `.releaserc.json``release-notes-generator` 增加 `presetConfig.types`
- `feat``fix``perf``refactor``deps``security``revert` 均保留可见 notes section
- 验证:
- `jq . .releaserc.json` 通过
- `npx --yes -p semantic-release -p conventional-changelog-conventionalcommits@9.1.0 semantic-release --dry-run --no-ci`
成功加载 `commit-analyzer``release-notes-generator`;随后在 `git fetch --tags` 阶段因远端 tag 会 clobber
本地既有 tags 而终止,未暴露 `presetConfig.types` 配置解析错误
- `dotnet build GFramework.sln -c Release` 通过,`0 warning / 0 error`
- 下一步是提交本轮 PR review 修复;如后续需要完整 semantic-release 版本预览,先处理本地 tag 与远端 tag 的
clobber 冲突。
## 2026-05-03
### patch 级提交类型扩展SEMREL-RP-005