Commit 495319f
fix: macOS 热更新 code signature 校验失败
根因:CI 上没有 Apple Developer 证书,electron-builder 跳过签名,
生成完全未签名的 .app。electron-updater 的 ShipIt 进程在应用更新时
校验 code signature,未签名的 app 被拒绝:
"Code signature did not pass validation: 代码未能满足指定的代码要求"
修复:
1. scripts/after-pack.js — 在所有文件修改(better-sqlite3 替换)
完成后,对 macOS .app 执行 ad-hoc 签名(codesign --force --deep -s -)。
Ad-hoc 签名不需要证书,但能通过 ShipIt 的基本校验。
如果将来配置了真实证书,electron-builder 的签名步骤会覆盖 ad-hoc。
2. .github/workflows/build.yml — macOS 构建添加
CSC_IDENTITY_AUTO_DISCOVERY=false,防止 electron-builder
尝试查找不存在的证书时产生不可预期的行为。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent cd4d718 commit 495319f
2 files changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
121 | 150 | | |
0 commit comments