Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ jobs:
security unlock-keychain -p 'ci-temp' /tmp/ci.keychain
# 私钥存在性校验(v0.2.7 根因:p12 仅证书链无私钥 → set-key-partition-list 报
# "SecItemCopyMatching: item not found" 的 cryptic 错误)。实测(macOS 本机):
# p12 含私钥 → "1 identity imported.";仅证书链 → "N certificates imported."(无 identity 行)
# import 输出捕获后校验 identity 行,缺失即明确报错,指引宿主重新导出含私钥的 p12。
# p12 含私钥 → "N identity(ies) imported."(1 个单数、多 个复数);仅证书链 → "N certificates imported."
# import 输出捕获后校验 identity/identities 行,缺失即明确报错,指引宿主重新导出含私钥的 p12。
IMPORT_OUTPUT="$(security import /tmp/signing.p12 -k /tmp/ci.keychain -P "$MACOS_SIGNING_P12_PASSWORD" \
-T /usr/bin/codesign -T /usr/bin/productsign 2>&1)"
echo "$IMPORT_OUTPUT"
if [[ "$IMPORT_OUTPUT" != *"identity imported"* ]]; then
if [[ ! "$IMPORT_OUTPUT" =~ identit(y|ies)\ imported ]]; then
echo "::error::MACOS_SIGNING_P12_BASE64 未包含可签名私钥(security import 仅导入证书链)。请从 Keychain Access 导出含私钥的 p12(证书右键 → 导出 → 勾选\"包含私钥\"),重新 base64 后更新 GitHub Secret。import 输出:${IMPORT_OUTPUT}"
exit 1
fi
Expand Down
Loading