build(release): 支持依赖与安全提交触发补丁发布

- 更新 semantic-release 规则,将 deps 与 security 提交映射为 patch 发布

- 补充 AGENTS 与贡献文档中的提交类型语义

- 记录 SEMREL-RP-005 验证结果与分支恢复入口
This commit is contained in:
gewuyou 2026-05-03 23:00:33 +08:00
parent a0591afa18
commit 53f8baf2ef
6 changed files with 52 additions and 8 deletions

View File

@ -33,6 +33,14 @@
"type": "refactor",
"release": "patch"
},
{
"type": "deps",
"release": "patch"
},
{
"type": "security",
"release": "patch"
},
{
"type": "docs",
"release": false

View File

@ -60,6 +60,10 @@ All AI agents and contributors must follow these rules when writing, reviewing,
`minor` segment.
- Use `fix` for behavior corrections, `perf` for observable performance improvements, and `refactor` only for
non-feature code restructuring; these should raise the next released version's `patch` segment.
- Use `deps` for dependency version updates, dependency lockfile refreshes, and package maintenance that should raise
the next released version's `patch` segment.
- Use `security` for vulnerability fixes, dependency security mitigations, and security configuration corrections
that should raise the next released version's `patch` segment.
- Use `docs``test``chore``build``ci``style` for their literal categories; do not encode these changes as
`feat` just because they feel important. These categories MUST NOT trigger a release.
- Use `BREAKING CHANGE` in the commit footer or `!` after the type / scope header (for example `feat!:` or

View File

@ -62,6 +62,9 @@ help the current worktree land on the right recovery documents without scanning
- Branch: `feat/semantic-release-versioning`
- Worktree hint: `GFramework`
- Priority 1: `semantic-release-versioning`
- Branch: `build/semantic-release-rules`
- Worktree hint: `GFramework`
- Priority 1: `semantic-release-versioning`
- Branch: `docs/sdk-update-documentation`
- Worktree hint: `GFramework-update-documentation`
- Priority 1: `documentation-full-coverage-governance`

View File

@ -8,17 +8,17 @@
- 用 `cycjimmy/semantic-release-action` 替换 `auto-tag.yml` 的版本判断和打 tag 逻辑
- 保留 `publish.yml` 的现有发布实现,不重写 NuGet 流程
- 避免 `semantic-release``publish.yml` 重复创建 GitHub Release
- 将版本规则固定为 `feat -> minor``fix/perf/refactor -> patch`、`BREAKING CHANGE``! -> major`
- 将版本规则固定为 `feat -> minor``fix/perf/refactor/deps/security -> patch`、`BREAKING CHANGE``! -> major`
- 为手动 `workflow_dispatch` 保留 dry-run 验证入口,先验证最近提交会算出什么版本
## 当前恢复点
- 恢复点编号:暂无
- 当前阶段:等待下一轮 semantic-release 维护任务
- 恢复点编号:SEMREL-RP-005
- 当前阶段:扩展 patch 级提交类型规则
- 当前焦点:
- `SEMREL-RP-004` 已归档到
`ai-plan/public/semantic-release-versioning/archive/todos/semantic-release-versioning-rp004-2026-05-02.md`
- 后续如 CI 或发布流程继续暴露 semantic-release 问题,再从新的恢复点编号开始记录
- `.releaserc.json` 增加 `deps -> patch``security -> patch`
- `AGENTS.md``docs/zh-CN/contributing.md` 同步提交类型说明
- `build/semantic-release-rules` 分支映射到当前 active topic
### 已知风险
@ -26,6 +26,7 @@
- `semantic-release` preview 虽然不会真实推送 tag但仍会执行远端 `git push --dry-run` 权限探测;如果 PAT 仅具备
read 权限、没有 `contents:write`,仍然会先于版本分析阶段失败
- `semantic-release` 的版本判断完全依赖 Conventional Commits不规范提交会直接影响版本计算
- `deps``security` 的发布语义需要同时维护在 `.releaserc.json``AGENTS.md` 和公开贡献文档中,避免规则漂移
- `cycjimmy/semantic-release-action@v6` 需要在 preview / release 两端都安装 `conventional-changelog-conventionalcommits`
以保证 `conventionalcommits` preset 在 GitHub Actions 中可解析
- `git-cliff-action``OUTPUT` 文件需要在 `softprops/action-gh-release` 执行时保留在当前工作目录,后续如调整
@ -45,10 +46,15 @@
## 验证
- `SEMREL-RP-004` 的本地验证结果已归档。
- `SEMREL-RP-005` 已完成本地验证:
- `jq . .releaserc.json` 通过
- `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`
- 更早阶段的 dry-run / tag /抽象项目验证已归档到
`ai-plan/public/semantic-release-versioning/archive/todos/semantic-release-versioning-2026-04-26.md`
## 下一步
1. 如 CI 仍报告 release notes 发布问题,再优先复查 `git-cliff-action` 输出文件路径与模板渲染结果
2. 下一轮 semantic-release 调整开始时创建新的恢复点编号
1. 将本轮规则扩展与跟踪文档更新提交到 `build/semantic-release-rules`
2. 如后续需要完整 semantic-release 版本预览,先处理本地 tag 与远端 tag 的 clobber 冲突

View File

@ -1,5 +1,26 @@
# Semantic Release 版本迁移追踪
## 2026-05-03
### patch 级提交类型扩展SEMREL-RP-005
- 本轮目标:
- 允许 `deps` 提交触发 patch 发布,用于依赖版本、依赖锁定和包维护变更
- 允许 `security` 提交触发 patch 发布,用于安全修复、漏洞缓解和安全配置修正
- 同步 `.releaserc.json``AGENTS.md`、公开贡献文档和 active topic 映射,避免 release 规则与提交规范漂移
- 已更新:
- `.releaserc.json`:新增 `deps -> patch``security -> patch`
- `AGENTS.md`:补充 `deps` / `security` 的 release 语义
- `docs/zh-CN/contributing.md`:补充公开贡献指南中的 Type 说明
- `ai-plan/public/README.md`:新增 `build/semantic-release-rules``semantic-release-versioning` 的分支映射
- 验证:
- `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 而终止,未暴露本轮配置解析错误
- `dotnet build GFramework.sln -c Release` 通过,`0 warning / 0 error`
- 下一步是提交本轮规则扩展;如后续需要完整 semantic-release 版本预览,先处理本地 tag 与远端 tag 的 clobber 冲突。
## 2026-05-01
### 发布说明 PR 归属展示SEMREL-RP-004

View File

@ -334,6 +334,8 @@ public TModel RegisterModel<TModel>(TModel model) where TModel : IModel
- **style**:代码格式调整(不影响功能)
- **refactor**:重构(不是新功能也不是修复)
- **perf**:性能优化
- **deps**:依赖版本、依赖锁定或包维护变更
- **security**:安全修复、漏洞缓解或安全配置修正
- **test**:添加或修改测试
- **chore**:构建过程或辅助工具的变动
- **ci**CI 配置文件和脚本的变动