[codex] refactor CI release workflows#133
Conversation
There was a problem hiding this comment.
PR #133 审查意见:重构 CI 发布工作流
总体评价
这是一个干净的 CI 工作流重构,质量良好。所有变更逻辑清晰,结构合理。
✅ 亮点
-
权限最小化:顶层
permissions从contents: write; pull-requests: write改为permissions: {},并在每个 job 中按需分配具体权限。release-plz-release仅获取contents: write+pull-requests: read,release-plz-pr获取contents: write+pull-requests: write。这是 GitHub Actions 安全最佳实践。 -
移除废弃的
release-assetsjob:删除了完整的二进制打包/上传流程(约 70 行 YAML),包括release事件触发和workflow_dispatch手动触发。无残留引用。 -
新增发布验证:在 Quality Check 中添加
cargo publish --workspace --dry-run --locked,可以在 CI 中提前发现发布配置问题。 -
YAML anchor 使用正确:所有 anchor(
&checkout、&install-rust、&release_env等)在第一个 job 中定义,在第二个 job 中正确复用。 -
简化触发条件:移除了冗余的
github.event_name == 'workflow_run'检查(因为on:触发器只有workflow_run)。
📝 轻微观察(非阻塞)
-
版本锁定放宽:
release-plz/action@v0.5.128→@v0.5,actions/checkout@v6.0.2→@v6。从精确版本改为 semver 范围,会自动获取补丁更新。对 CI 来说可接受,但如果项目对供应链安全有严格要求,可考虑保持精确版本。 -
cargo publish --dry-run未指定--target:其他步骤均使用--target ${{ matrix.targets }},但cargo publish是注册表操作,通常不需要--target。当前 matrix 仅有x86_64-unknown-linux-gnu(即宿主平台),无问题。
验证结果
git diff --check:通过 ✅- 无残留 Pages/deploy/release-assets 引用:通过 ✅
- 工作区所有 crate 无
publish = false,dry-run 覆盖完整:通过 ✅ - YAML 结构有效(无 tab 缩进):通过 ✅
结论
APPROVE — 变更清晰、安全、符合最佳实践,可以合并。
Powered by mimo-v2.5-pro
Summary
cargo publish --workspace --dry-run --lockedto Quality CheckNotes
Quality Checkworkflow runs onmainrelease-plz/action@v0.5.github/workflowsValidation
git diff --checkyaml.safe_loadrgsearch for Pages/release-assets residuecargo fmt --all -- --checkcargo clippy --target x86_64-unknown-linux-gnu --all-featureswith temporary pnpm 10.33.0 wrappercargo build --target x86_64-unknown-linux-gnu --all-featureswith temporary pnpm 10.33.0 wrappercargo publish --workspace --dry-run --lockedwith temporary pnpm 10.33.0 wrapperLocal test caveat
cargo test --target x86_64-unknown-linux-gnu -- --nocapturewas blocked locally becausemkimage/u-boot-toolsis missing; CI installsu-boot-tools.