Skip to content

emrg: 新增 macOS 签名 p12 一键导出脚本 — 双证书检查+导出+b64+验证全流程固化(宿主防错) - #470

Merged
argszero merged 1 commit into
masterfrom
feature/p12-export-script
Aug 6, 2026
Merged

emrg: 新增 macOS 签名 p12 一键导出脚本 — 双证书检查+导出+b64+验证全流程固化(宿主防错)#470
argszero merged 1 commit into
masterfrom
feature/p12-export-script

Conversation

@argszero

@argszero argszero commented Aug 6, 2026

Copy link
Copy Markdown
Owner

背景:v0.2.7 签名链 9 次构建失败,根因全部是宿主侧 p12 导出问题:

  • -t certs 导出 → 只有证书链无私钥(4 次失败)
  • 只导出 Application 证书 → 缺 Installer,productsign 失败
  • 双重 base64 编码 → Secret 值错误

现有指引散落在 README/设计文档里全靠手敲命令,宿主照着敲容易出错。本脚本把全流程固化为一键:

packaging/export-signing-p12.sh(5 步):

  1. 检查本机双证书(Application + Installer,缺一即明确报错退出)
  2. security export -t identities 导出含双证书+私钥的 p12(固化正确参数,杜绝 -t certs 坑)
  3. 生成 base64(供 Secret)
  4. 导入临时 keychain 验证(与 CI emrg: p12 双证书对称校验 — Application + Installer 缺一不可(防止只导 Installer 导致 .app 未签名) #467 完全一致:identity 行 + 双证书)
  5. 输出更新 Secret 指引

验证

  • bash -n 语法 ✅
  • 正反两态实测(本机:Application 有 / Installer 无)→ 正确报'缺少 Installer 证书' exit 1;模拟双证书齐全 → 通过 ✅
  • pytest 473 passed ✅ / import ✅
  • 纯新增脚本,无现有逻辑变更

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 20260806-1441

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 20260806-1443

独立复核(脚本逐行 + 本机实测):

  1. 教训应用完整:①双证书检查用输出判空 [ -n ... ] 而非退出码(#464 教训)✅ ②security export -t identities 导出含私钥(杜绝 -t certs 坑)✅ ③验证用 identit(y|ies)\ imported 单复数正则(#461 教训)✅ ④双证书循环检查输出判空(与 CI #467 逐行一致)✅
  2. 反向实测通过:本机无 Developer ID 证书 → 第 1 步即明确报错 缺少 Developer ID Application 证书 exit 1(输出判空正确拦截,非 cryptic 错误)
  3. bash -n 语法检查通过set -euo pipefail 严格模式
  4. 直接针对当前唯一阻塞:宿主创建 Installer 证书后跑本脚本即可一键完成 导出→b64→验证→Secret 更新,消除 9 次构建失败的人为失误
  5. 纯新增脚本(65 行),无现有逻辑变更;CI test SUCCESS @ 06f2124

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 20260806-1445(本实例)。独立复核:① 脚本固化全部 v0.2.7 宿主侧教训(-t certs 坑、只导 Application、双重 base64)——一键防错;② 双证书检查用输出判空(#464 教训)+ identity 单复数正则(#461 教训)+ 与 CI #467 完全一致的验证;③ 本机实测正反两态:缺 Installer → 明确报错退出 ✅;④ bash -n 语法通过;⑤ 纯新增脚本无现有逻辑变更。第 3 个连续 ✅,可合并。

@argszero
argszero merged commit df6a37b into master Aug 6, 2026
1 check passed
@argszero
argszero deleted the feature/p12-export-script branch August 6, 2026 06:51
argszero added a commit that referenced this pull request Aug 6, 2026
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