Skip to content

[6128] macOS CD:修复 pkg 签名与公证不生效 - #4765

Merged
MoonL79 merged 1 commit into
mainfrom
cms/6128/macos-pkg-sign
Oct 27, 2026
Merged

MoonL79 merged 1 commit into
mainfrom
cms/6128/macos-pkg-sign

Conversation

@MoonL79

@MoonL79 MoonL79 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

问题

macOS CD 产出的 .pkg 一直没被签名和公证过,vpk 只是打了一行告警:

[WRN] Package installer (.pkg) will not be Notarized. This is supported with the --signInstallIdentity and --notaryProfile arguments.

未签名/未公证的 pkg 会被 Gatekeeper 直接拦掉。按提示补上 Installer 身份后,CI 反而卡死到 timeout-minutes(60 分钟)被杀,pack 阶段零输出。

三处原因与修复

  1. Installer 身份查不到 —— security find-identity -p codesigning 只收录 Code Signing 用途的证书,Developer ID Installer 的 EKU 是 1.2.840.113635.100.4.13,会被这条策略整条滤掉,于是 INSTALL_IDENTITY 为空、vpk 退化到「不签 pkg」的分支。改用默认(basic)策略。
  2. 授权对象写错 —— vpk 1.2.0 的 OsxBuildTools.CreateInstallerPkg 只用 pkgbuild/productbuild,签 pkg 是 productbuild --sign,从不用 productsign,且不给 productbuild 传 --keychain(靠 default-keychain 定位)。之前只授权了 codesign/productsign,productbuild 用私钥时会去等 SecurityAgent 授权框——headless runner 上没人点,进程就静默挂死。补上 -T /usr/bin/productbuild 与 partition list 里的 productbuild: 后 25 秒完成签名。
  3. secret 名对齐 —— 引用改为仓库现有的 APPLE_CERTIFICATE_P12_BASE64。

验证

tag v2026.3.8-test4 触发 macOS CD(run 40441694022),25 分钟 success,beta/stable 双通道完整链路:

03:18:13 Creating installer '.pkg'
03:18:38 Installer created successfully        (含 productbuild --sign,25s)
03:18:39 Preparing to Notarize                 (pkg 公证)
03:20:03 Notarization completed
03:20:04 Verifying signature/notarization for installer package using spctl...

Release 产出 MoganSTEM-v2026.3.8-rc.3-arm.pkg,spctl -a -t install 通过。

范围说明

只改 .github/workflows/cd_on_macos_arm64.yml。测试分支上临时注释掉的 Debian 13 / Fedora / Windows CD 的 tag 触发不在本 PR 内,保持 main 原状。

@MoonL79
MoonL79 merged commit 67e7c0a into main Oct 27, 2026
@MoonL79
MoonL79 deleted the cms/6128/macos-pkg-sign branch October 27, 2026 06:35
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