From 96ea9928e0d342f45911a132b0cc5cd794234a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=83=E5=B7=9D=E7=99=BD=E6=B5=AA?= <105714958+Nwflower@users.noreply.github.com> Date: Sat, 5 Dec 2026 20:14:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8C=89=E6=8F=90=E4=BA=A4=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E8=A7=A6=E5=8F=91=E6=BB=9A=E5=8A=A8=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E7=89=88=E6=9E=84=E5=BB=BA=EF=BC=88#199=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 11 +++++++++-- changes/dev-release-title-filter.json | 7 +++++++ docs/testing.md | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 changes/dev-release-title-filter.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b305a5..7c0a2a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,8 +45,15 @@ jobs: PREVIOUS_SHA: ${{ github.event.before }} shell: pwsh run: | - $publish = $true - if ($env:PREVIOUS_SHA -notmatch '^0+$') { + # Read the commit object so shallow checkouts retain its parent headers. + $commitLines = @(git cat-file commit HEAD) + if ($LASTEXITCODE -ne 0) { throw 'Could not read the main commit' } + $headerEnd = [Array]::IndexOf($commitLines, '') + if ($headerEnd -lt 1) { throw 'Could not locate the main commit message' } + $parents = @($commitLines[0..($headerEnd - 1)] -like 'parent *') + $subject = $commitLines[$headerEnd + 1] + $publish = $parents.Count -le 1 -and $subject -like '*#*' -and $subject -notlike '*docs*' + if ($publish -and $env:PREVIOUS_SHA -notmatch '^0+$') { git fetch --depth=1 origin $env:PREVIOUS_SHA if ($LASTEXITCODE -ne 0) { throw 'Could not fetch the previous main commit' } $changed = git diff --name-only $env:PREVIOUS_SHA HEAD -- . ':(exclude)docs/**' ':(exclude)README.md' ':(exclude,glob)README.*.md' ':(exclude)AGENTS.md' ':(exclude).github/ISSUE_TEMPLATE/**' ':(exclude).github/PULL_REQUEST_TEMPLATE.md' ':(exclude).github/readme/**' diff --git a/changes/dev-release-title-filter.json b/changes/dev-release-title-filter.json new file mode 100644 index 0000000..0439e55 --- /dev/null +++ b/changes/dev-release-title-filter.json @@ -0,0 +1,7 @@ +{ + "group": "chores", + "order": 0, + "authors": ["Nwflower"], + "zh": "滚动开发版仅在合入主分支的提交标题包含 `#` 且不包含 `docs` 时自动构建。", + "en": "Automatically build rolling Dev releases only when the commit title on the main branch contains `#` and does not contain `docs`." +} diff --git a/docs/testing.md b/docs/testing.md index 34e4f9f..991862c 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -13,7 +13,7 @@ | 核对发布候选 | `node scripts/test.mjs release` | 使用 `desktop,production` 构建标签运行同一套 Go 检查,禁用测试结果缓存并随机化用例顺序 | | Windows 桌面冒烟 | `node scripts/test.mjs webview2 build/bin/reims-go.exe` | 启动已构建的客户端,在真实 WebView2 中完成首启数据目录设置 | -GitHub CI 额外检查变更日志、工作区纪律、前端生产打包、Windows GUI 可执行文件的 `version` 输出与 WebView2 首启。`main` 的滚动版复用同一提交的 CI 测试,手动构建会跑 CI 测试并冒烟。带版本标签的发布与每日 Alpha 先跑发布候选测试,再对待发布的 EXE 运行桌面冒烟。两个发布流程都在上传前验证实际 EXE 的版本、ZIP 内的文件和 SHA-256 校验和。 +GitHub CI 额外检查变更日志、工作区纪律、前端生产打包、Windows GUI 可执行文件的 `version` 输出与 WebView2 首启。滚动开发版检查推送到 `main` 的最新提交消息的第一行,包含 `#` 且不包含 `docs`(忽略大小写)时才复用该提交的 CI 测试自动构建。自动构建跳过有多个父提交的合并提交及纯文档推送。手动构建会跑 CI 测试并冒烟。带版本标签的发布与每日 Alpha 先跑发布候选测试,再对待发布的 EXE 运行桌面冒烟。两个发布流程都在上传前验证实际 EXE 的版本、ZIP 内的文件和 SHA-256 校验和。 桌面冒烟需要已安装 WebView2 Runtime 的 Windows 桌面会话。测试通过 Windows UI Automation 填入独立的数据目录、点击继续,检查配置和目录指针落盘,并等待运行时设置页渲染。每次运行使用独立的 WebView2 配置目录。失败时,测试入口打印保留的目录,应用日志在其中的 `app.log`。