Repository navigation
refactor: 发布复用测试构建产物,省一次全量构建 - #163
Conversation
同一 commit 被 build-exe 与 release 各完整构建一遍(≈8-11min)。release 改为按 commit 复用 build-exe 产物,只重盖版本戳后归档;无可用产物则回退全量构建。 - build-exe: 顶层加可复现构建常量(与 release 一致);Rust 产物由 zip 改未打包目录 - release: 定位同 commit run → gh run download → prepare 重盖版本戳 → archive;补 actions: read
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe build workflow sets shared UTF-8 and deterministic-build values and uploads the checked Rust package directory. The release workflow looks for build artifacts from the same commit, reuses them when valid, or builds packages as a fallback. Tag releases now include GUI and Rust archives and checksums. ChangesBuild and Release Artifact Flow
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The release workflow now reuses build artifacts from the same commit and falls back to a full build when they are unavailable. No merge-blocking issue was found. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
背景
同一个 commit 被完整构建两遍:
Build EXE & Run Exe Tests(push main/PR)与Release Build(pushv*tag)各自跑一遍 PyInstaller + cargo(≈8–11 min)。而 tag 指向的正是 main 上那个已被构建过的 commit。改动
build-exe.yml
SOURCE_DATE_EPOCH/PYTHONHASHSEED(与 release.yml 完全一致 ⇒ 两个 workflow 产物字节相同);PYTHONUTF8提到顶层。deploy/dist/rust/OneDragon-Helper(发布流程要重盖版本戳后再归档)。release.yml
$GITHUB_SHA定位同 commit 上成功的 build-exe run →gh run download两个产物 →release_package.py prepare重盖版本戳 → archive → create release。permissions补actions: read(跨 workflow 下载产物)。验证
gh run list --workflow=build-exe.yml --event push --commit <sha> --status success能命中目标 run,产物名一致。--dir回填层级正确。自审(CodeRabbit 标准)
shell: bash带-e:gh run list失败会中断整个 job,到不了 fallback|| run_id=""shell: pwsh只取最后一条命令退出码:两条prepare/archive首条失败被掩盖 ⇒ 可能发布带 dev 版本戳的包shell: bashgh run download仍成功,prepare才炸且不回退version.json存在性守卫 → 走 fallback已知限制
--workflow=build-exe.yml硬编码:改名后静默退化为全量构建。uv sync+ submodule checkout(≈1 min 空转,fallback 需要)。注意
OneDragon-Helper-Rust-windows产物形态由 ZIP 变目录(7 天保留的 CI 调试产物,唯一消费者是发布流程)。Summary by CodeRabbit