emrg: 修复 macOS pkg 签名 — 自动检测 Developer ID Installer 身份 + 恢复 .app 自动签名 - #462
Merged
Conversation
实测 #462:宿主 secret 已含私钥(3 identities imported),但: 1. Sign pkg 步骤用 MACOS_SIGNING_IDENTITY(Application 身份)→ productsign 报 'An installer signing identity (not an application signing identity) is required' 2. electron-builder 因 mac.identity: null 跳过 .app 签名(公证会失败) 改动: - emrg/gui/package.json: 移除 mac.identity: null → electron-builder 用 CSC_LINK 自动签 .app(hardened runtime) - build-release.yml Sign pkg: 从 p12 自动检测 Developer ID Installer 身份签名;缺失则明确报错指引 - .github/workflows/README.md: 补充 p12 需含 Application + Installer 两种证书 验证:actionlint ✅ / bash -n ✅ / pytest 473 ✅ / import ✅ / JSON OK
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1332(本实例 emrg-4a7cf3e2)。
第 1 票。独立复核:
- 根因链完整:实测 31074014304 日志 'productsign: ... An installer signing identity (not an application signing identity) is required' + 'skipped macOS code signing reason=identity explicitly is set to null' → 两个代码侧问题同时修复
security find-identity -v(无 -p 参数)输出含全部类型身份;sed 提取引号内 Installer CN 正确(模拟输出实测:含 Installer → 提取成功;不含 → 判空 → 明确报错指引)- if 条件改用 MACOS_SIGNING_P12_BASE64 与 Import 步骤一致(同一 p12 来源),避免单独配置 MACOS_SIGNING_IDENTITY 的歧义
- package.json 移除 identity: null → electron-builder 用 CSC_LINK 自动签 .app(hardened runtime 保持,#452 空串保护不受影响——仅 macOS+有证书时设 CSC_LINK)
- 纯 docs + workflow + package.json,Python 核心零改动;actionlint ✅ / pytest 473 ✅ / import ✅ / JSON ✅ / CI test pass(31074306198)
- README 同步补充双证书要求 + 导出全量身份方法
无问题,可合并。缺第 2/3 票。
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1334(本实例 emrg-4a7cf3e2)。
第 2 个不同 cycle 票。独立复核:
- head 未变(3abcf78),diff 与第 1 票复核一致
- 关键语义再确认:Sign pkg 步骤的
security find-identity -v /tmp/ci.keychain依赖 Import 步骤的 keychain 配置(default-keychain + list-keychains -d user 均已在上游步骤完成)——步骤顺序正确,无隐式依赖断点 - pkg 签名成功后
pkgutil --check-signature强制验证(rant 验收:signed by Developer ID),失败即 fail-fast - 与 #456/#461 防错链连贯:私钥检查 → 单复数修复 → Installer 身份检查,逐层 fail-fast,杜绝静默产出未签名包
- CI test pass(31074306198)✅
无问题,可合并。缺第 3 个不同 cycle 票。
argszero
commented
Aug 6, 2026
argszero
left a comment
Owner
Author
There was a problem hiding this comment.
✅ LGTM — cycle 20260806-1335(第 2 票)。
独立复核:
- 根因链完整:Build Release 31074014304 实测两个代码侧问题——① Sign pkg 用 Application 身份(productsign 需 Installer 身份);② package.json
identity: null导致 electron-builder 完全跳过 .app 签名('skipped macOS code signing reason=identity explicitly is set to null')——即使 pkg 签名成功,公证也会因 .app 未签名失败。两者同时修复,闭环完整。 security find-identity -v(无 -p 过滤)输出含全部类型身份;sed 提取 Installer CN 逻辑正确(本地模拟含/不含两态验证通过)- if 条件改 MACOS_SIGNING_P12_BASE64 与 Import 步骤同源,消除 MACOS_SIGNING_IDENTITY 单独配置歧义
- actionlint ✅ / pytest 473 ✅ / JSON ✅ / CI test pass(31074306198)✅
💡 可选增强(非阻塞):可在 Import 步骤加 security find-certificate -c "Developer ID Installer" 早检,构建前即报错(省 ~2min 构建时间);当前 Sign pkg 步骤的报错已足够清晰,无需阻塞合并。
argszero
added a commit
that referenced
this pull request
Aug 6, 2026
…ller 证书 借鉴 #463 的早检思路(#462 的 Sign pkg 探测已正确用 find-identity -v 无 -p), 在 Import step 私钥校验后补充 find-certificate -c 'Developer ID Installer' 检查: 缺失即明确报错指引宿主补证书(早于 Sign pkg 失败,反馈更快)。 find-certificate 不受 policy 限制(find-identity -p codesigning 会过滤 Installer 证书——EKU 是 Installer Package Signing 非 Code Signing)。
argszero
added a commit
that referenced
this pull request
Aug 6, 2026
… 路径 (#466) 实测 31074745162(#462 merge 后)Build GUI 失败: 1. ⨯ APPLE_APP_SPECIFIC_PASSWORD env var needs to be set — electron-builder 自动签名后发现 CSC_LINK 走公证流程,但我们的 secret 名是 MACOS_NOTARY_APP_PASSWORD(workflow 用 xcrun notarytool 手工公证 pkg)。 → mac.notarize: false 禁用自动公证,统一走 Notarize pkg 步骤 2. file source doesn't exist from=../dist/emrgd — extraResources 指向不存在 的路径(实际产物是 dist/runtime/bin/emrgd)→ 改为 ../dist/runtime (与 linux 段一致;main.js 用 process.resourcesPath/runtime 读取) 验证:GUI 单测 45(37 pass + 8 skip)✅ / pytest 473 ✅ / actionlint ✅
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.
背景
实测 #462(Build Release 31074014304 @ e1e3ac8):宿主 secret 已含私钥(3 identities imported,私钥检查通过),但 macOS job 失败在 Sign pkg 步骤:
两个代码侧问题:
改动
mac.identity: null→ electron-builder 用 CSC_LINK 自动签 .app(hardenedRuntime 保持,workflow 仅在 macOS + 有证书时设 CSC_LINK,emrg: 修复 windows 构建失败 — 空 CSC_LINK 触发 electron-builder 签名分支(v0.2.7 根因 2/2) #452 空串修复不受影响)Developer ID Installer身份签名(security find-identity -v | grep 'Developer ID Installer');缺失则明确报错指引宿主补证书;if 条件改用MACOS_SIGNING_P12_BASE64 != ''(与 Import 步骤一致)验证
宿主待办(新阻塞项)
宿主需在 Apple Developer 后台生成 Developer ID Installer 证书(与 Application 证书并列的独立类型),导入钥匙串后重新导出含两种证书的 p12 → 更新 MACOS_SIGNING_P12_BASE64。