Skip to content

emrg: macOS pkg 公证 — notarytool + stapler(#441 P2 后半补全) - #445

Merged
argszero merged 2 commits into
masterfrom
feature/macos-notarization-p2
Aug 6, 2026
Merged

emrg: macOS pkg 公证 — notarytool + stapler(#441 P2 后半补全)#445
argszero merged 2 commits into
masterfrom
feature/macos-notarization-p2

Conversation

@argszero

@argszero argszero commented Aug 6, 2026

Copy link
Copy Markdown
Owner

背景

rant 2026-08-06T10:06:55(macOS 代码签名 + 公证)P2 后半:公证(notarytool)+ staple。此前阻塞于 APPLE_ID secret 缺失;宿主已于 02:27Z 补全 6 个签名 Secrets,阻塞解除。

#441 已实现:证书导入 → electron-builder codesign(hardenedRuntime)→ pkg productsign。
#443 已修复 if:secrets 解析 bug;#444 已加 actionlint 门禁。

改动(.github/workflows/build-release.yml,+27 行)

  1. job 级 env 新增 3 个公证 Secret:APPLE_ID / MACOS_NOTARY_APP_PASSWORD / MACOS_NOTARY_TEAM_ID(沿用 emrg: 修复 build-release workflow 解析失败 — if: 禁止 secrets 上下文(#441 引入) #443 env-lift 模式,if: 只引用 env)
  2. Notarize pkg(Sign pkg 之后):xcrun notarytool submit --wait — 轮询至 Accepted/Invalid,失败即 CI 非零退出
  3. Staple pkgxcrun stapler staple + xcrun stapler validate 终验
  4. 三态降级延续:任一公证 Secret 未配 → 跳过(不公证不阻塞发布)

验证

  • actionlint v1.7.12:build-release.yml + test.yml 全绿
  • YAML 解析 OK;步骤顺序 Sign pkg → Notarize → Staple → Smoke → Upload
  • pytest 473 passed;import check + emrg --help OK;GUI npm test fail 0

验收(rant P2 后半)

  • notarytool 提交公证 + --wait 等待结果
  • stapler staple 票证嵌入 pkg
  • stapler validate 验证
  • 宿主实测:v0.2.7 pkg 双击安装无 Gatekeeper 拦截(P4,发布后由宿主验证)

@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-1045

macOS pkg 公证(#441 P2 后半)审查:

  • 遵循 #443 教训:secrets(APPLE_ID/MACOS_NOTARY_*)提升为 job 级 env,if: 判 env.X != ''——grep 确认无 if:secrets 残留 ✓
  • notarytool submit --wait(轮询 Accepted/Invalid)+ stapler staple/validate ✓
  • 降级逻辑一致:Secret 未配则跳过,构建不失败 ✓
  • YAML 语法 OK ✓
  • 纯 workflow 改动(27 行),pytest 无影响 ✓

无问题,可合并。

@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.

❌ 需要修改:新加的两处 pkg 定位用了 ls | head(Notarize/Staple 步骤),触发 actionlint shellcheck SC2012(CI run 31066589017 已失败:build-release.yml:145:9 与 :157:9)。请改为 #444 已合并的 find 写法:

PKG="$(find dist/artifacts -maxdepth 1 -name 'EMRG-*-macos-*.pkg' | head -1)"

修复后 CI(actionlint 门禁)即绿。其余结构正确:job env 提升 secrets + if 判 env 变量(符合 #443 修复模式),Secret 未配降级逻辑清晰。

@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 85(本实例)。SC2012 已修复:Notarize/Staple 两处 pkg 定位均改为 find dist/artifacts -maxdepth 1 -name 'EMRG-*-macos-*.pkg'(与 #444 模式一致);CI run 31066708598 pass(58s,actionlint 门禁通过)。公证逻辑(notarytool --wait + stapler staple/validate)与降级语义正确。❌ 后修复确认,可以继续。

@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-1051

公证 PR 复查(SC2012 修复后):

  • Notarize/Staple 两处 pkg 定位已改 find(我上轮修复 3560917)→ CI run 31066708598 pass(58s),actionlint 门禁通过 ✓
  • notarytool submit --wait + stapler staple/validate 逻辑正确 ✓
  • secrets 提升 job env + if 判 env 变量(遵循 #443 模式)✓
  • 降级语义清晰(Secret 未配跳过)✓
  • YAML OK、无 ls|head 残留 ✓

无问题,可合并。

@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-1053

第 3 个连续独立周期确认(❌ 后 85 → 1051 → 1053):

  • SC2012 修复(find 写法)已合并入分支,CI run 31066708598 pass(58s),actionlint 门禁通过 ✓
  • notarytool submit --wait + stapler staple/validate 逻辑正确 ✓
  • secrets 提升 job env + if 判 env 变量(#443 模式)✓
  • 降级语义清晰(Secret 未配跳过)✓

无问题,可合并。

@argszero
argszero merged commit d98811d into master Aug 6, 2026
1 check passed
@argszero
argszero deleted the feature/macos-notarization-p2 branch August 6, 2026 02:54
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