From 66bb2b1f4937d96de0bb89e41b09e554f4fd438e Mon Sep 17 00:00:00 2001 From: EMRG Evolution Date: Thu, 6 Aug 2026 14:16:31 +0800 Subject: [PATCH] =?UTF-8?q?emrg:=20docs=20=E2=80=94=20README=20=E8=A1=A5?= =?UTF-8?q?=E5=85=85=20p12=20=E5=8F=8C=E8=AF=81=E4=B9=A6=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=91=BD=E4=BB=A4=20+=20CI=20=E6=97=A9?= =?UTF-8?q?=E6=A3=80=E8=A1=8C=E4=B8=BA=E8=AF=B4=E6=98=8E=EF=BC=88#467=20?= =?UTF-8?q?=E5=AF=B9=E7=A7=B0=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 810b1d37..8aa9c496 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -19,6 +19,8 @@ **`.app` 签名**需要 **Developer ID Application** 证书;**pkg 签名**(`productsign`)需要 **Developer ID Installer** 证书——两者是独立的证书类型,缺一不可: - 只有 Application 证书 → `.app` 签名成功,但 `Sign pkg` 步骤报错 `An installer signing identity (not an application signing identity) is required`(实测 #462) +- 只有 Installer 证书 → electron-builder codesign `.app` 找不到 Application 身份 → 跳过签名 → 公证失败(#467 对称校验) +- **CI 早检**(#464/#467):Import step 会校验**双证书 + 私钥**三者齐备,任一缺失即明确报错,构建立即失败(不等到 Sign pkg/公证) - 两个证书都要在 Apple Developer 后台生成(Certificates → 分别创建两种类型),下载安装到钥匙串后**一并导出**到 p12(`security export -t identities` 会导出全部证书+私钥对) **检查本机已有哪些身份**: @@ -52,11 +54,14 @@ security export -k ~/Library/Keychains/login.keychain-db -t identities -f pkcs12 # 用导出的 p12 更新 MACOS_SIGNING_P12_BASE64 和 MACOS_SIGNING_P12_PASSWORD(导出密码) ``` -**验证 p12 含私钥**: +**验证 p12 含私钥 + 双证书**(与 CI #467 检查对称,更新 Secret 前本地确认,避免一轮构建浪费): ```bash security import 你的证书.p12 -k /tmp/test.keychain -P 密码 # 输出 "1 identity imported." → ✅ 含私钥 # 输出 "N certificates imported."(无 identity 行)→ ❌ 不含私钥,重新导出 +# 双证书齐备检查(与 CI Import step 完全一致;任一为空 = 缺证书,重新导出) +security find-certificate -c "Developer ID Application" -a /tmp/test.keychain 2>/dev/null # 非空 ✅ +security find-certificate -c "Developer ID Installer" -a /tmp/test.keychain 2>/dev/null # 非空 ✅ ``` **更新 secret**: