Merge pull request #293 from GeWuYou/feat/semantic-release-versioning

Feat/semantic release versioning
This commit is contained in:
gewuyou 2026-04-26 11:15:23 +08:00 committed by GitHub
commit 524d54d3de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 413 additions and 48 deletions

View File

@ -1,6 +1,6 @@
---
name: gframework-pr-review
description: Repository-specific GitHub PR review workflow for the GFramework repo. Use when Codex needs to inspect the GitHub pull request for the current branch, extract AI review findings from CodeRabbit or greptile-apps, read failed checks, MegaLinter warnings, or failed test signals from the PR page, and then verify which findings should be fixed in the local codebase. Trigger explicitly with $gframework-pr-review or with prompts such as "look at the current PR", "extract CodeRabbit comments", "extract Greptile comments", or "check Failed Tests on the PR".
description: Repository-specific GitHub PR review workflow for the GFramework repo. Use when Codex needs to inspect the GitHub pull request for the current branch, extract AI review findings from CodeRabbit, greptile-apps, or gemini-code-assist, read failed checks, MegaLinter warnings, or failed test signals from the PR page, and then verify which findings should be fixed in the local codebase. Trigger explicitly with $gframework-pr-review or with prompts such as "look at the current PR", "extract CodeRabbit comments", "extract Greptile comments", "extract Gemini comments", or "check Failed Tests on the PR".
---
# GFramework PR Review
@ -20,7 +20,7 @@ Shortcut: `$gframework-pr-review`
- fetch PR metadata, issue comments, reviews, and review comments through the GitHub API
- extract CodeRabbit-specific summary blocks such as `Summary by CodeRabbit` and actionable-comment rollups when present
- parse the latest CodeRabbit review body itself, including folded sections such as `🧹 Nitpick comments (N)` and the overall AI-agent prompt
- capture unresolved latest-head review threads for supported AI reviewers, including both `coderabbitai[bot]` and `greptile-apps[bot]`
- capture unresolved latest-head review threads for supported AI reviewers, including `coderabbitai[bot]`, `greptile-apps[bot]`, and `gemini-code-assist[bot]`
- surface which supported AI reviewers currently have open latest-commit review threads, even when they do not use CodeRabbit-style issue comments
- fetch the latest head commit review threads from the GitHub PR API
- prefer unresolved review threads on the latest head commit over older summary-only signals
@ -53,7 +53,7 @@ Shortcut: `$gframework-pr-review`
The script should produce:
- PR metadata: number, title, state, branch, URL
- Supported AI reviewer summary, including latest reviews and open-thread counts for `coderabbitai[bot]` and `greptile-apps[bot]`
- Supported AI reviewer summary, including latest reviews and open-thread counts for `coderabbitai[bot]`, `greptile-apps[bot]`, and `gemini-code-assist[bot]`
- CodeRabbit summary block from issue comments when available
- Folded latest-review sections such as `Nitpick comments (N)` when CodeRabbit puts them in the review body instead of issue comments
- Parsed latest head-review threads, with unresolved threads clearly separated
@ -72,7 +72,7 @@ The script should produce:
- If the current WSL session resolves `git.exe` but cannot execute it cleanly, keep using the explicit Linux worktree binding instead of retrying Windows Git.
- Prefer GitHub API results over PR HTML. The PR HTML page is now a fallback/debugging source, not the primary source of truth.
- If the summary block and the latest head review threads disagree, trust the latest unresolved head-review threads and treat older summary findings as stale until re-verified locally.
- Do not assume every AI reviewer behaves like CodeRabbit. `greptile-apps[bot]` findings may exist only as latest-head review threads, without CodeRabbit-style issue comments or folded review-body sections.
- Do not assume every AI reviewer behaves like CodeRabbit. `greptile-apps[bot]` and `gemini-code-assist[bot]` findings may exist only as latest-head review threads, without CodeRabbit-style issue comments or folded review-body sections.
- Treat GitHub Actions comments with `Success with warnings` as actionable review input when they include concrete linter diagnostics such as `MegaLinter` detailed issues; do not skip them just because the parent check is green.
- Do not assume all CodeRabbit findings live in issue comments. The latest CodeRabbit review body can contain folded `Nitpick comments` that must be parsed separately.
- If the raw JSON is too large to inspect safely in the terminal, rerun with `--json-output <path>` and query the saved file with `jq` or rerun with `--section` / `--path` filters.
@ -84,5 +84,6 @@ The script should produce:
- `Use $gframework-pr-review on the current branch`
- `Check the current PR and extract CodeRabbit suggestions`
- `Check the current PR and extract Greptile suggestions`
- `Check the current PR and extract Gemini Code Assist suggestions`
- `Look for Failed Tests on the PR page`
- `先用 $gframework-pr-review 看当前分支 PR`

View File

@ -29,6 +29,7 @@ WORK_TREE_ENVIRONMENT_KEY = "GFRAMEWORK_WORK_TREE"
USER_AGENT = "codex-gframework-pr-review"
CODERABBIT_LOGIN = "coderabbitai[bot]"
GREPTILE_LOGIN = "greptile-apps[bot]"
GEMINI_CODE_ASSIST_LOGIN = "gemini-code-assist[bot]"
GITHUB_ACTIONS_LOGIN = "github-actions[bot]"
REVIEW_COMMENT_ADDRESSED_MARKER = "<!-- <review_comment_addressed> -->"
VISIBLE_ADDRESSED_IN_COMMIT_PATTERN = re.compile(r"\s*Addressed in commit\s+[0-9a-f]{7,40}", re.I)
@ -47,6 +48,12 @@ SUPPORTED_AI_REVIEWERS = (
"display_name": "Greptile",
"supports_review_body_parsing": False,
},
{
"slug": "gemini-code-assist",
"login": GEMINI_CODE_ASSIST_LOGIN,
"display_name": "Gemini Code Assist",
"supports_review_body_parsing": False,
},
)
DISPLAY_SECTION_CHOICES = (
"pr",

View File

@ -1,66 +1,174 @@
name: Auto Increment Version and Tag
name: Semantic Release Version and Tag
on:
workflow_run:
workflows: ["CI - Build & Test"]
types:
- completed
branches:
- main
workflow_dispatch:
concurrency:
group: auto-tag-main
group: semantic-release-main
cancel-in-progress: false
jobs:
auto-tag:
preview:
if: >
(
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
contains(github.event.workflow_run.head_commit.message, '[release ci]')
)
||
(
github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/main'
)
github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
contents: read
outputs:
tagged: ${{ steps.create_tag.outcome == 'success' }}
published: ${{ steps.semantic_release.outputs.new_release_published }}
last_tag: ${{ steps.semantic_release.outputs.last_release_git_tag }}
next_version: ${{ steps.semantic_release.outputs.new_release_version }}
next_tag: ${{ steps.semantic_release.outputs.new_release_git_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.sha }}
- name: Get next version
id: version
run: |
LATEST_TAG=$(git tag --list "v*" --sort=-v:refname | head -n 1)
LATEST_TAG=${LATEST_TAG:-v0.0.0}
VERSION=${LATEST_TAG#v}
IFS=. read MAJOR MINOR PATCH <<< "$VERSION"
PATCH=$((PATCH+1))
echo "new_tag=v$MAJOR.$MINOR.$PATCH" >> $GITHUB_OUTPUT
- name: Create tag
# preview 始终先运行,用于给当前 SHA 生成待发布版本预览。
- name: Semantic release preview
id: semantic_release
uses: cycjimmy/semantic-release-action@v6
with:
dry_run: true
ci: false
extra_plugins: |
conventional-changelog-conventionalcommits@9.1.0
env:
PAT: ${{ secrets.PAT_TOKEN }}
TAG: ${{ steps.version.outputs.new_tag }}
run: |
set -e
git config user.name "GitHub Action"
git config user.email "action@github.com"
GITHUB_TOKEN: ${{ github.token }}
if git show-ref --tags --verify --quiet "refs/tags/$TAG"; then
echo "Tag $TAG already exists, skipping"
exit 0
- name: Show preview result
run: |
echo "published=${{ steps.semantic_release.outputs.new_release_published }}"
echo "last_tag=${{ steps.semantic_release.outputs.last_release_git_tag }}"
echo "next_version=${{ steps.semantic_release.outputs.new_release_version }}"
echo "next_tag=${{ steps.semantic_release.outputs.new_release_git_tag }}"
- name: Write preview summary
env:
RELEASE_PUBLISHED: ${{ steps.semantic_release.outputs.new_release_published }}
RELEASE_NOTES: ${{ steps.semantic_release.outputs.new_release_notes }}
run: |
{
echo "## Semantic Release Preview"
echo
echo "- Commit: \`${{ github.sha }}\`"
echo "- Release needed: \`${{ steps.semantic_release.outputs.new_release_published }}\`"
echo "- Last tag: \`${{ steps.semantic_release.outputs.last_release_git_tag }}\`"
echo "- Next version: \`${{ steps.semantic_release.outputs.new_release_version }}\`"
echo "- Next tag: \`${{ steps.semantic_release.outputs.new_release_git_tag }}\`"
echo "- Snapshot semantics: this preview is pinned to dispatch SHA \`${{ github.sha }}\`; commits added to \`main\` after the run starts are not included."
if [ "${RELEASE_PUBLISHED}" = "true" ] && [ -n "${RELEASE_NOTES}" ]; then
echo
echo "<details><summary>Preview release notes</summary>"
echo
printf '%s\n' "${RELEASE_NOTES}"
echo
echo "</details>"
fi
echo
echo "If the version looks correct, approve the \`release-approval\` environment to continue."
} >> "${GITHUB_STEP_SUMMARY}"
release:
if: >
github.ref == 'refs/heads/main' &&
needs.preview.result == 'success' &&
needs.preview.outputs.published == 'true'
needs:
- preview
runs-on: ubuntu-latest
permissions:
contents: write
environment:
name: release-approval
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.sha }}
- name: Validate PAT token
env:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
REPO_API_URL: ${{ github.api_url }}/repos/${{ github.repository }}
run: |
if [ -z "${PAT_TOKEN}" ]; then
echo "::error::PAT_TOKEN is required because a tag created with GITHUB_TOKEN will not trigger publish.yml."
exit 1
fi
git tag -a "$TAG" -m "Auto tag $TAG"
git push "https://x-access-token:${PAT}@github.com/${{ github.repository }}.git" "$TAG"
response_file="$(mktemp)"
status_code="$(
curl -sS -o "${response_file}" -w "%{http_code}" \
-H "Authorization: Bearer ${PAT_TOKEN}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"${REPO_API_URL}"
)"
case "${status_code}" in
200)
;;
401|403)
echo "::error::PAT_TOKEN is invalid or lacks access to ${GITHUB_REPOSITORY} (HTTP ${status_code})."
cat "${response_file}"
exit 1
;;
*)
echo "::error::Failed to validate PAT_TOKEN against ${REPO_API_URL} (HTTP ${status_code})."
cat "${response_file}"
exit 1
;;
esac
- name: Semantic release
id: semantic_release
uses: cycjimmy/semantic-release-action@v6
with:
dry_run: false
extra_plugins: |
conventional-changelog-conventionalcommits@9.1.0
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Show release result
run: |
echo "published=${{ steps.semantic_release.outputs.new_release_published }}"
echo "preview_last_tag=${{ needs.preview.outputs.last_tag }}"
echo "preview_next_version=${{ needs.preview.outputs.next_version }}"
echo "preview_next_tag=${{ needs.preview.outputs.next_tag }}"
echo "last_tag=${{ steps.semantic_release.outputs.last_release_git_tag }}"
echo "next_version=${{ steps.semantic_release.outputs.new_release_version }}"
echo "next_tag=${{ steps.semantic_release.outputs.new_release_git_tag }}"
- name: Write release summary
env:
RELEASE_PUBLISHED: ${{ steps.semantic_release.outputs.new_release_published }}
RELEASE_NOTES: ${{ steps.semantic_release.outputs.new_release_notes }}
run: |
{
echo "## Semantic Release Publish"
echo
echo "- Commit: \`${{ github.sha }}\`"
echo "- Preview last tag: \`${{ needs.preview.outputs.last_tag }}\`"
echo "- Preview next version: \`${{ needs.preview.outputs.next_version }}\`"
echo "- Preview next tag: \`${{ needs.preview.outputs.next_tag }}\`"
echo "- Published: \`${{ steps.semantic_release.outputs.new_release_published }}\`"
echo "- Last tag: \`${{ steps.semantic_release.outputs.last_release_git_tag }}\`"
echo "- Next version: \`${{ steps.semantic_release.outputs.new_release_version }}\`"
echo "- Next tag: \`${{ steps.semantic_release.outputs.new_release_git_tag }}\`"
echo "- Snapshot semantics: this publish run still uses dispatch SHA \`${{ github.sha }}\`; commits added to \`main\` after the preview started are excluded."
if [ "${RELEASE_PUBLISHED}" = "true" ] && [ -n "${RELEASE_NOTES}" ]; then
echo
echo "<details><summary>Published release notes</summary>"
echo
printf '%s\n' "${RELEASE_NOTES}"
echo
echo "</details>"
fi
} >> "${GITHUB_STEP_SUMMARY}"

82
.releaserc.json Normal file
View File

@ -0,0 +1,82 @@
{
"branches": [
"main"
],
"tagFormat": "v${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "conventionalcommits",
"releaseRules": [
{
"breaking": true,
"release": "major"
},
{
"revert": true,
"release": "patch"
},
{
"type": "feat",
"release": "minor"
},
{
"type": "fix",
"release": "patch"
},
{
"type": "perf",
"release": "patch"
},
{
"type": "refactor",
"release": "patch"
},
{
"type": "docs",
"release": false
},
{
"type": "test",
"release": false
},
{
"type": "chore",
"release": false
},
{
"type": "build",
"release": false
},
{
"type": "ci",
"release": false
},
{
"type": "style",
"release": false
}
],
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES"
]
}
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "conventionalcommits",
"parserOpts": {
"noteKeywords": [
"BREAKING CHANGE",
"BREAKING CHANGES"
]
}
}
]
]
}

View File

@ -55,6 +55,21 @@ All AI agents and contributors must follow these rules when writing, reviewing,
- The commit `body` MUST use unordered list items, and each item MUST start with a verb such as `新增``修复``优化`
`更新``补充``重构`.
- Each commit body bullet MUST describe one independent change point; avoid repeated or redundant descriptions.
- Commit `type` MUST reflect release semantics instead of author intent:
- Use `feat` only for user-facing or consumer-facing capability additions that should raise the next released version's
`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 `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
`feat(core)!:`) when the change should raise the next released version's `major` segment.
- Documentation-only changes MUST NOT use `feat`, including new guides, refreshed examples, navigation updates, and
adoption notes for existing capabilities. If a commit changes both product behavior and related docs, either split the
commit or use `feat` only when the code/package behavior is the primary released change.
- Contributors MUST avoid ambiguous scopes such as `feat(docs)` for documentation work. If the change only affects docs,
prefer `docs(<module-or-area>)`; if it adds a real capability in a docs-related toolchain, use the scope of that
actual subsystem instead of `docs`.
- Keep technical terms in English when they are established project terms, such as `API``Model``System`.
- When composing a multi-line commit body from shell commands, contributors MUST NOT rely on Bash `$"..."` quoting for
newline escapes, because it passes literal `\n` sequences to Git. Use multiple `-m` flags or ANSI-C `$'...'`

View File

@ -43,6 +43,10 @@ help the current worktree land on the right recovery documents without scanning
- Purpose: continue the data repository persistence hardening plus the settings / serialization follow-up backlog.
- Tracking: `ai-plan/public/data-repository-persistence/todos/data-repository-persistence-tracking.md`
- Trace: `ai-plan/public/data-repository-persistence/traces/data-repository-persistence-trace.md`
- `semantic-release-versioning`
- Purpose: migrate release version calculation from fixed patch bumps to semantic-release while keeping the existing tag-driven NuGet publish flow.
- Tracking: `ai-plan/public/semantic-release-versioning/todos/semantic-release-versioning-tracking.md`
- Trace: `ai-plan/public/semantic-release-versioning/traces/semantic-release-versioning-trace.md`
## Worktree To Active Topic Map
@ -63,6 +67,9 @@ help the current worktree land on the right recovery documents without scanning
- Branch: `feat/data-repository-persistence`
- Worktree hint: `GFramework-data-repository-persistence`
- Priority 1: `data-repository-persistence`
- Branch: `feat/semantic-release-versioning`
- 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

@ -0,0 +1,101 @@
# Semantic Release 版本迁移跟踪
## 目标
将版本管理从固定 `patch + 1` 的自动打 tag 迁移到 `semantic-release`,同时保留现有 `.github/workflows/publish.yml`
的 tag 触发打包、NuGet 发布、GitHub Packages 发布和 GitHub Release 流程。
- 用 `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`
- 为手动 `workflow_dispatch` 保留 dry-run 验证入口,先验证最近提交会算出什么版本
## 当前恢复点
- 恢复点编号:`SEMREL-RP-002`
- 当前阶段:`Phase 2`
- 当前焦点:
- 让 `.releaserc.json``BREAKING CHANGE``feat!:` / `feat(scope)!:``major` 语义与文档保持一致
- 将 `auto-tag.yml` 的 preview / release 输出与 PR review 建议对齐,避免 release notes 被静默丢弃
- 提前校验 `PAT_TOKEN` 的真实可用性,并把当前 PR review 修复结果同步回 `AGENTS.md` 与 active trace
### 已知风险
- `GITHUB_TOKEN` 推送 tag 不会再触发另一个 workflow真实发布仍需要 `PAT_TOKEN`
- `semantic-release` 的版本判断完全依赖 Conventional Commits不规范提交会直接影响版本计算
- `cycjimmy/semantic-release-action@v6` 需要在 preview / release 两端都安装 `conventional-changelog-conventionalcommits`
以保证 `conventionalcommits` preset 在 GitHub Actions 中可解析
- 当前仓库本地 `dotnet clean/build` 会带出既有 analyzer warnings本轮仅修正发版配置与文档不额外处理这些历史 warning
## 已完成
- 已确认当前版本入口为 `.github/workflows/auto-tag.yml`,现状始终执行 `PATCH + 1`
- 已确认当前 `.github/workflows/publish.yml` 由 tag 触发,并负责 `.nupkg` 打包、发布和 GitHub Release
- 已确认最新 tag 为 `v0.0.222`
- 已确认 `v0.0.222..HEAD` 之间存在 `feat(...)` 提交,按目标规则首次 dry-run 预期版本应为 `v0.1.0`
- 已新增 `.releaserc.json`,仅保留 `@semantic-release/commit-analyzer`
`@semantic-release/release-notes-generator`,避免 `semantic-release` 直接创建 GitHub Release
- 已将 `.releaserc.json``commit-analyzer` / `release-notes-generator` 同步切换到 `conventionalcommits`
preset并显式声明
- `breaking -> major`
- `revert -> patch`
- `feat -> minor`
- `fix/perf/refactor -> patch`
- `docs/test/chore/build/ci/style -> no release`
- 已将 `.github/workflows/auto-tag.yml` 重写为:
- `workflow_dispatch` 启动后总是先跑 `preview`
- `preview` 只执行 dry-run输出 `last_tag``next_version``next_tag`
- `release` job 依赖 `preview` 输出,并通过 `release-approval` environment 暂停等待人工确认
- 人工批准后,`release` 在同一 SHA 上执行真实打 tag并把 preview / release 结果都写入 job summary
- 已按 PR review 修复 `auto-tag.yml`
- 删除 preview job 中与 job 级 `if` 重复的运行时分支校验
- 为 release job 增加 `needs.preview.result == 'success'` 守卫
- 为 preview / release 的 semantic-release action 显式安装 `conventional-changelog-conventionalcommits@9.1.0`
- 在 release 前通过 GitHub API 校验 `PAT_TOKEN` 是否真实可访问当前仓库
- 在 preview / release summary 中补充 snapshot 语义与生成的 release notes
- 已明确真实打 tag 仍使用 `PAT_TOKEN`,因为 `GITHUB_TOKEN` 推送的 tag 不会继续触发 `publish.yml`
- 已更新 `AGENTS.md` 的 Conventional Commit 规则,显式补充:
- `fix/perf/refactor -> patch`
- `docs/test/chore/build/ci/style -> no release`
- `BREAKING CHANGE``!` header -> major
- 已移除基于 `workflow_run``[release ci]` 的自动发版门闸,后续版本预览与真实发版都由维护者手动触发
- 已将 release 流程从“两次独立 workflow_dispatch”收敛为“同一次 run 里 preview + 审批 + release”的链路
- 已精简 active trace移除已废弃的 `release_mode=preview|release` 中间方案,保留当前有效恢复点
## 验证
- `git describe --tags --abbrev=0`
- 结果:通过
- 备注:当前最新 tag 为 `v0.0.222`
- `git log --pretty=format:%h%x09%s v0.0.222..HEAD`
- 结果:通过
- 备注:最近版本窗口内存在多条 `feat(...)`,后续 dry-run 预期应提升 `minor`
- `dotnet build GFramework.Core.Abstractions/GFramework.Core.Abstractions.csproj -c Release -p:RestoreFallbackFolders=`
- 结果:通过
- 备注:`GFramework.Core.Abstractions``GFramework.Cqrs.Abstractions` Release 构建通过,`0 warning / 0 error`
- `npx --yes semantic-release --dry-run --no-ci`
- 结果:受阻
- 备注:当前工作树的本地 tag 历史在 `git fetch --tags` 阶段出现 `would clobber existing tag` 冲突,不能直接作为 dry-run 环境
- `git clone --branch main --single-branch git@github.com:GeWuYou/GFramework.git /tmp/gframework-semrel-dryrun`
- 结果:通过
- 备注:已建立干净临时克隆用于 dry-run 验证
- `npx --yes semantic-release --dry-run --no-ci`(在 `/tmp/gframework-semrel-dryrun`
- 结果:通过
- 备注dry-run 成功识别 `v0.0.222` 为最新 release并分析 `269` 个提交;按当前规则会提升到下一次 `minor` 发布,预期 tag 为 `v0.1.0`
- `npx --yes -p semantic-release -p conventional-changelog-conventionalcommits@9.1.0 semantic-release --dry-run --no-ci`(在 `/tmp/gframework-semrel-dryrun`
- 结果:通过
- 备注:成功加载 `@semantic-release/commit-analyzer``@semantic-release/release-notes-generator`,证明
`conventionalcommits` preset 包可被解析;本次 dry-run 未继续出版本,是因为干净克隆的 `main` 已落后远端
- `dotnet build GFramework.Core.Abstractions/GFramework.Core.Abstractions.csproj -c Release -p:RestoreFallbackFolders=`(手动发版入口调整后复验)
- 结果:通过
- 备注:`0 warning / 0 error`
- `dotnet build GFramework.sln -c Release`
- 结果:通过
- 备注Release 构建完成,`639 warning / 0 error`warning 为仓库既有基线,与本轮 workflow / doc 改动无新增关联项
## 下一步
1. 复核当前 PR review 的 open threads 是否只剩等待 push 的已修复项
2. 将本轮修复提交到当前分支,等待 GitHub reviewer 重新评估
3. 若后续需要,再在真实仓库主线最新快照上复验一次 `semantic-release` dry-run 结果展示

View File

@ -0,0 +1,44 @@
# Semantic Release 版本迁移追踪
## 2026-04-26
### 当前恢复点SEMREL-RP-002
- 当前链路:
- `workflow_dispatch` 手动启动
- `preview` 对 dispatch SHA 执行 dry-run
- `release-approval` environment 审批
- `release` 在同一次 run、同一 SHA 上执行真实打 tag
- 当前规则:
- `conventionalcommits` preset 负责解析 `feat!:` / `feat(scope)!:``BREAKING CHANGE`
- `feat -> minor`
- `fix/perf/refactor -> patch`
- `docs/test/chore/build/ci/style -> no release`
- `breaking -> major`
- 当前 workflow 加固:
- `release` 额外要求 `needs.preview.result == 'success'`
- `PAT_TOKEN` 在真实 release 前通过 GitHub API 做存活性校验
- preview / release summary 会展示 snapshot 语义与生成的 release notes
### 本轮关键决策
- 保留 `@semantic-release/release-notes-generator`,但不再让它白跑:
- 继续生成 notes
- 将 notes 写入 GitHub Actions summary
- 不保留已废弃的 `release_mode=preview|release` 中间方案:
- active trace 只保留当前有效链路
- 历史演进以 tracking 文档的已完成项为准
### 验证结论
1. `npx --yes -p semantic-release -p conventional-changelog-conventionalcommits@9.1.0 semantic-release --dry-run --no-ci`
- 已确认新 preset 包可加载,`commit-analyzer``release-notes-generator` 正常初始化
- 本次 dry-run 未继续出版本,因为干净克隆的 `main` 已落后远端
2. `dotnet build GFramework.sln -c Release`
- 通过,`639 warning / 0 error`
- warning 为仓库既有基线,本轮未新增关联 warning
### 下一步
1. 复查当前 PR 的 open review threads 是否只剩等待 push 的已修复项
2. 创建提交并推送当前分支