Skip to content

Improve nightly preview release workflow - #384

Open
wysaid wants to merge 4 commits into
masterfrom
agent/nightly-preview-release
Open

Improve nightly preview release workflow#384
wysaid wants to merge 4 commits into
masterfrom
agent/nightly-preview-release

Conversation

@wysaid

@wysaid wysaid commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • 新功能
    • 发布流程支持手动测试、正式版、无效标签回退及 nightly 预览发布。
    • 新增 Windows MSVC x64 Release 可执行文件,并随发布内容提供下载。
    • 按工具链拆分并打包七类静态库,附带版本、渠道、提交和工具链信息。
  • 改进
    • GitHub Release 支持草稿、预发布、最新版本标记及替换已有 nightly 发布。
    • 发布页面新增更详细的下载说明。

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@wysaid, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 25 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 809942c1-2041-4784-a8a8-7ac039bf50ae

📥 Commits

Reviewing files that changed from the base of the PR and between 0f932e3 and bd25f24.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Walkthrough

发布工作流新增发布配置输出、Windows MSVC x64 Release 可执行文件构建、按工具链拆分的库包,以及 nightly 发布替换和详细 Release 产物说明。

Changes

发布流水线

Layer / File(s) Summary
发布属性与 nightly 配置
.github/workflows/release.yml
validate-and-setup 根据手动测试、正式标签、无效标签和 master 推送设置发布渠道及 GitHub Release 属性。手动版本通过 INPUT_VERSION 读取并校验。master 推送改为 nightly 预发布。
可执行文件与工具链库包
.github/workflows/release.yml
新增 Windows MSVC v143 x64 Release 构建任务。发布流程按工具链生成七类独立库包,并写入版本、渠道、提交和工具链信息。
发布产物与 GitHub Release
.github/workflows/release.yml
发布任务汇总可执行文件包和拆分库包。GitHub Release 使用验证阶段的配置,并支持删除旧 nightly 发布、强制更新 nightly 标签和更新下载说明。

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • x-ege/xege#299:同样修改 GitHub Actions,以构建和打包 Windows 工具链产物,包括 MSVC/MinGW 静态库和可执行文件。
  • x-ege/xege#377:同样修改 .github/workflows/release.yml 的 Windows/MSVC 发布构建配置,包括 runner 和工具链设置。

Poem

兔子校验发布包,
MSVC 可执行文件入篮。
七类工具链整齐打包,
nightly 标签更新。
Release 带上新说明,
兔耳朵轻轻鼓掌。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了发布工作流的主要变更,尤其是 nightly preview release 流程的改进。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/nightly-preview-release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

478-481: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

建议关闭凭据持久化。

该 job 不执行 git 推送操作。actions/checkout 默认把 GITHUB_TOKEN 写入 .git/config,凭据可能被后续步骤或产物意外携带。设置 persist-credentials: false 可缩小暴露面。

🔒 建议改动
       - name: Checkout repository
         uses: actions/checkout@v4
         with:
           submodules: recursive
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 478 - 481, Update the
actions/checkout step in the release job to disable credential persistence by
setting persist-credentials to false alongside the existing recursive submodule
configuration.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Line 767: Update the 7z command in the release packaging step to run from
$PACKAGE_DIR and archive only the package directory name, preventing an extra
release-assets/ path prefix inside the ZIP.
- Around line 814-831: Update the release lookup around release_json so curl
failures are not suppressed indiscriminately: treat HTTP 404 as “no existing
release,” but propagate or fail the workflow for 5xx responses, network errors,
timeouts, and other non-success statuses. Preserve the existing deletion flow
when a release is found and the “No existing release” message only for a
confirmed 404.
- Around line 494-519: Update the “Package executables” PowerShell step to
receive the version through the step’s env mapping instead of interpolating
needs.validate-and-setup.outputs.version inside the script. Validate the
resulting version before constructing $dist, permitting only a safe
artifact/path character set and exiting with a clear error for invalid values;
continue using the validated value for the directory, README, archive, and
downstream artifact naming.

---

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 478-481: Update the actions/checkout step in the release job to
disable credential persistence by setting persist-credentials to false alongside
the existing recursive submodule configuration.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 452f4dcd-cf15-4b51-b64b-f6fe1fe67563

📥 Commits

Reviewing files that changed from the base of the PR and between 9f97f1d and 6f29abb.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
@wysaid
wysaid force-pushed the agent/nightly-preview-release branch from 6f29abb to a524bbb Compare August 9, 2026 18:42

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
.github/workflows/release.yml (5)

46-47: 🔒 Security & Privacy | 🟠 Major

不要把原始 tag 直接用于脚本、版本和工件路径。

github.ref_name 在当前脚本中直接插值。GitHub 将 ref 内容视为不可信输入。Git ref 也允许使用 / 分隔组件。形如 v25.11/foo 的 tag 会使回退版本包含 /,从而破坏下游目录名和 artifact 名称。(docs.github.com)

请通过环境变量传入 github.refgithub.ref_name。验证后只使用安全 slug,原始 tag 仅用于日志。

建议改动
         env:
           INPUT_VERSION: ${{ inputs.version }}
+          INPUT_REF: ${{ github.ref }}
+          INPUT_REF_NAME: ${{ github.ref_name }}
...
-          elif [ "${{ github.event_name }}" = "push" ] && [ -n "${{ github.ref_name }}" ] && [[ "${{ github.ref }}" == refs/tags/* ]]; then
+          elif [ "${{ github.event_name }}" = "push" ] && [ -n "$INPUT_REF_NAME" ] && [[ "$INPUT_REF" == refs/tags/* ]]; then
...
-            TAG_NAME="${{ github.ref_name }}"
+            TAG_NAME="$INPUT_REF_NAME"
+            TAG_SLUG=$(printf '%s' "$TAG_NAME" | sed 's/[^A-Za-z0-9._-]/_/g')
...
-              VERSION="${VERSION}-tag-${TAG_NAME}"
+              VERSION="${VERSION}-tag-${TAG_SLUG}"
...
-              echo "version_tag=test-${TAG_NAME}" >> $GITHUB_OUTPUT
+              echo "version_tag=test-${TAG_SLUG}" >> $GITHUB_OUTPUT

Also applies to: 151-155

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 46 - 47, 更新 release workflow
中使用版本和工件路径的逻辑:不要将 github.ref 或 github.ref_name
直接插入脚本、版本或路径。将其通过环境变量传入,在校验后生成并复用不含路径分隔符的安全 slug;原始 tag 仅保留用于日志输出,并确保
INPUT_VERSION 等下游值使用该安全 slug。

Source: MCP tools


135-140: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

不要同时设置 release_draft=truerelease_make_latest=true

GitHub REST API 不允许 draft 或 prerelease 被设为 latest。当前官方分支会同时传入这两个值,发布请求可能直接失败;若需要先审核,将 release_make_latest 设为 false,草稿发布后再单独更新为 latest。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 135 - 140, Update the official
release output configuration around release_draft and release_make_latest so it
does not enable both simultaneously. Set release_make_latest to false when
release_draft remains true, preserving the existing draft workflow; any later
promotion to latest must occur separately after publication.

Source: MCP tools


345-360: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

让 MinGW 构建步骤在失败时立即失败。

shell: msys2 {0}shell: cmd 都是命令解释器,不会自动终止失败后的后续命令。WinLibs 步骤中 cmake --build ... 失败后,仍会执行 mkdir build-releasecd build-releasecmake ..,导致错误被后续成功命令掩盖并上传不完整 artifacts。

请在 MSYS2 脚本开头添加 set -euo pipefail;在前置 CMD 和 MSYS2 构建步骤的每条易失败命令后添加 || exit /b 1 / || exit,再继续后续收集命令;在上传前也要确认 .a 库文件已生成。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 345 - 360, Update the MSYS2 build
step around “Build with MSYS2” to enable fail-fast behavior with set -euo
pipefail, and ensure each failure-prone setup or CMake command stops the script
before artifact collection. Apply the corresponding explicit failure exits to
the preceding CMD and MSYS2 build steps as requested, and validate that at least
one .a library exists before uploading artifacts.

Source: MCP tools


362-380: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

为 WinLibs 压缩包增加 SHA-256 校验。

该步骤会使用第三方 release asset 解压后提供的 cmakegccmakeninja 构建发布产物,但只对下载完成和解压是否失败做判断。如果压缩资产被替换,构建器和最终产物都可能被篡改。为每个矩阵项配置对应 zip 的 SHA-256,在下载后、Expand-Archive 前先校验,校验失败立即终止工作流。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 362 - 380, 在“Download and Setup
WinLibs GCC”步骤中为每个矩阵项增加对应 ZIP 的 SHA-256 配置,并在 Invoke-WebRequest
成功后、Expand-Archive 执行前计算 mingw64.zip 的哈希并与 matrix
中的期望值严格比较;校验失败时输出错误并立即以失败状态终止工作流,校验通过后再继续解压。

173-186: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

nightly 发布增加并发保护或提交校验。

master 推送使用固定 version_tag=nightly,并且 replace_existing_release=true。当前工作流没有 concurrency 限制,后续步骤会强制移动和重新创建 refs/tags/nightly,较旧提交的工作流如果最后完成会覆盖最新提交的 nightly 发布。请添加按 master-nightly 的 concurrency 取消旧运行,或在强制推送前校验 nightly 是否仍指向本次提交。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 173 - 186, 为 nightly
发布流程增加并发保护,使用工作流级别或相关 job 的 concurrency 配置按 master-nightly
分组,并取消正在运行的旧任务;确保较旧提交的工作流不会继续覆盖最新的 nightly 标签和发布。保留现有 nightly 输出设置,包括
version_tag、replace_existing_release 和发布名称配置。
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

204-256: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

请固定 VS 构建使用的 Windows runner。

VS2019 和 VS2022 矩阵都使用 windows-latest。截至 2026 年 8 月 9 日,该标签指向 Windows Server 2025,且 runner 镜像内容会变化。相同的 v142v143 配置可能使用不同的生成器和工具链版本,导致发布产物不可复现。(github.com)

请使用固定镜像,例如 windows-2022,或显式安装并验证所需工具链。

建议改动
-            os: windows-latest
+            os: windows-2022
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 204 - 256, Replace the
windows-latest runner in every VS2019 and VS2022 matrix entry with a fixed
Windows image such as windows-2022, keeping the existing v142/v143,
architecture, and configuration combinations unchanged.

Source: MCP tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/release.yml:
- Around line 46-47: 更新 release workflow 中使用版本和工件路径的逻辑:不要将 github.ref 或
github.ref_name 直接插入脚本、版本或路径。将其通过环境变量传入,在校验后生成并复用不含路径分隔符的安全 slug;原始 tag
仅保留用于日志输出,并确保 INPUT_VERSION 等下游值使用该安全 slug。
- Around line 135-140: Update the official release output configuration around
release_draft and release_make_latest so it does not enable both simultaneously.
Set release_make_latest to false when release_draft remains true, preserving the
existing draft workflow; any later promotion to latest must occur separately
after publication.
- Around line 345-360: Update the MSYS2 build step around “Build with MSYS2” to
enable fail-fast behavior with set -euo pipefail, and ensure each failure-prone
setup or CMake command stops the script before artifact collection. Apply the
corresponding explicit failure exits to the preceding CMD and MSYS2 build steps
as requested, and validate that at least one .a library exists before uploading
artifacts.
- Around line 362-380: 在“Download and Setup WinLibs GCC”步骤中为每个矩阵项增加对应 ZIP 的
SHA-256 配置,并在 Invoke-WebRequest 成功后、Expand-Archive 执行前计算 mingw64.zip 的哈希并与
matrix 中的期望值严格比较;校验失败时输出错误并立即以失败状态终止工作流,校验通过后再继续解压。
- Around line 173-186: 为 nightly 发布流程增加并发保护,使用工作流级别或相关 job 的 concurrency 配置按
master-nightly 分组,并取消正在运行的旧任务;确保较旧提交的工作流不会继续覆盖最新的 nightly 标签和发布。保留现有 nightly
输出设置,包括 version_tag、replace_existing_release 和发布名称配置。

---

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 204-256: Replace the windows-latest runner in every VS2019 and
VS2022 matrix entry with a fixed Windows image such as windows-2022, keeping the
existing v142/v143, architecture, and configuration combinations unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b4a1c75e-abab-4000-b6f0-49a7fa502040

📥 Commits

Reviewing files that changed from the base of the PR and between f21c50f and 0f932e3.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant