emrg: 修复 windows 构建失败 — 空 CSC_LINK 触发 electron-builder 签名分支(v0.2.7 根因 2/2) - #452
Merged
Conversation
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1111(本实例)。独立复核:① 根因确认——v0.2.7 windows job 日志 Env WIN_CSC_LINK is not correct, cannot resolve: ...emrg\gui not a file,空字符串 CSC_LINK 触发 electron-builder 签名分支(path.resolve('') = 工作目录);② 修复正确——bash 内条件导出,非 macOS/无证书完全不设置变量,electron-builder 未检测到 CSC_LINK 则不签名(降级不变);③ actionlint 全绿 + YAML OK + pytest 473;④ CI test pass(31067915869)。第 1 个 ✅。
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 87(本实例)。CSC_LINK 空字符串 → electron-builder 签名分支(path.resolve('') = 工作目录)根因确认;run 内条件 export 修复正确(非 macOS 完全不设置,降级不变)。actionlint 全绿 + CI pass(54s)+ pytest 473。第 3 个不同 cycle ✅(1111 + 86 + 87),可合并。
argszero
added a commit
that referenced
this pull request
Aug 6, 2026
v0.2.7 四次构建失败(583f59f/05a088e/827d90f/a4bbbd3)均卡在 Import signing certificate:set-key-partition-list 报 SecItemCopyMatching item not found。诊断 run(workflow_dispatch 31068768892)确认根因: **MACOS_SIGNING_P12_BASE64 只含 7 个证书(证书链),不含私钥**—— find-identity 0 valid identities + keychain 私钥数 0。 这不是 workflow 代码问题(#450/#452/#453 修复均正确,本地含私钥 p12 验证 set-key-partition-list 通过),而是 secret 配置问题:导出 p12 时未勾选包含私钥。 改进:import 后加私钥存在性检查(dump-keychain 数 key class), 0 私钥时输出 ::error:: 明确提示(重新导出含私钥 p12 + 更新 secret), 替代 cryptic 的 SecItemCopyMatching。 验证:actionlint 全绿(exit 0)。
argszero
added a commit
that referenced
this pull request
Aug 6, 2026
v0.2.7 四次构建失败(583f59f/05a088e/827d90f/a4bbbd3)均卡在 Import signing certificate:set-key-partition-list 报 SecItemCopyMatching item not found。诊断 run(workflow_dispatch 31068768892)确认根因: **MACOS_SIGNING_P12_BASE64 只含 7 个证书(证书链),不含私钥**—— find-identity 0 valid identities + keychain 私钥数 0。 这不是 workflow 代码问题(#450/#452/#453 修复均正确,本地含私钥 p12 验证 set-key-partition-list 通过),而是 secret 配置问题:导出 p12 时未勾选包含私钥。 改进:import 后加私钥存在性检查(dump-keychain 数 key class), 0 私钥时输出 ::error:: 明确提示(重新导出含私钥 p12 + 更新 secret), 替代 cryptic 的 SecItemCopyMatching。 验证:actionlint 全绿(exit 0)。
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
v0.2.7 Build Release(run 31067519195)windows-2025 job 失败:
根因:#441 引入的 Build GUI step env 表达式在非 macOS 上求值为空字符串:
electron-builder 对空字符串 CSC_LINK 仍走签名分支(
cscLink != null→ 真),path.resolve("")= 工作目录 → 报 not a file。v0.2.6 发布在 #441 合并之前,故首次暴露于 v0.2.7 构建。(macOS job 失败是另一个根因——set-key-partition-list 缺 -s,由 #450 修复。)
修复
将 CSC_LINK/CSC_KEY_PASSWORD 从 step env 移到 bash 内条件导出:
验证
emrg --helpOK后续
#450 + 本 PR 合并后,重打 v0.2.7 tag 触发完整构建(4 job 全绿 + macOS 签名公证链验证)。