Skip to content

ci(release): Developer ID署名とnotarizationでGatekeeper警告をなくす - #102

Merged
pranc1ngpegasus merged 3 commits into
mainfrom
ci/developer-id-signing-notarization
Aug 2, 2026
Merged

ci(release): Developer ID署名とnotarizationでGatekeeper警告をなくす#102
pranc1ngpegasus merged 3 commits into
mainfrom
ci/developer-id-signing-notarization

Conversation

@pranc1ngpegasus

@pranc1ngpegasus pranc1ngpegasus commented Jul 28, 2026

Copy link
Copy Markdown
Member

概要

リリースワークフローのアドホック署名を、Developer ID Application署名 + Appleの公証(notarization)+ stapling に置き換えます。GitHub ReleasesからダウンロードしたWisp.app / DMGを、Gatekeeperが正規の配布物として検証できるようにします。

Important

Apple Developer Programへの加入、Developer ID証明書の発行、App Store Connect Team Keyの発行、GitHub Secretsの登録は完了済みです。現在は初回のapp公証がIn Progressのため、end-to-end確認が終わるまでdraftを維持します。

非同期notarization

Appleの初回公証が長時間In Progressになる場合でもmacOSランナーを占有しないよう、提出と後続処理を分離しました。

  1. build / sign / submit.github/workflows/release.yaml
    • Wispをビルドし、Developer ID Applicationでinside-out署名
    • .appをZIPにしてnotarytool submit--waitなし)
    • Submission ID、署名済みapp、リリース情報をpending Artifactへ保存して終了
    • 証明書Secretがないフォークでは従来どおりアドホック署名へフォールバック
  2. poll / resume.github/workflows/notary-monitor.yaml
    • 15分ごとのcronで、まずUbuntuランナーがpending Artifactの有無を走査
    • pendingがある場合だけmacOS 26を起動し、notarytool historynotarytool infoで状態確認
    • In Progress: 即終了して次回cronへ
    • Accepted(app): appへticketをstapleし、DMGを作成・非同期提出
    • Accepted(DMG): DMGへticketをstapleし、test ArtifactまたはGitHub Releaseを公開
    • Invalid / Rejected: notary logをdiagnostic Artifactへ保存して失敗
  3. 耐久ステート
    • wisp-notary-app-*wisp-notary-dmg-*wisp-notary-done-* のimmutable Actions Artifactで状態遷移
    • monitorはreusable workflowでもあり、releasemonitor_only: trueから手動実行可能

appとDMGを別々に公証するため、DMGだけでなく内包するWisp.appにもticketをstapleでき、オフライン初回起動にも対応します。

GitHub Secrets

以下は登録済みです。

  • MACOS_CERTIFICATE_P12_BASE64
  • MACOS_CERTIFICATE_PASSWORD
  • APPLE_NOTARY_KEY_ID
  • APPLE_NOTARY_ISSUER_ID
  • APPLE_NOTARY_KEY_P8_BASE64

公証用の鍵は、Individual Keyではなくnotarytool対応のApp Store Connect Team Keyです。

検証

  • actionlint + ShellCheck: 成功
  • 非同期build / sign / submit: 成功(3分25秒)
    • Developer ID証明書import成功
    • codesign成功
    • app提出成功
    • pending Artifact保存成功
  • 手動poll: 成功
    • Artifact探索: 3秒
    • macOSでのhistory/info確認: 11秒
    • app状態: In Progress
    • build jobはskip

AppleがappをAcceptedにした後、app stapling → DMG提出 → DMG stapling → 最終Artifact生成まで確認します。

Replace ad-hoc signing in the release workflow with real Developer ID
Application signing, Apple notarization, and stapling so downloaded
builds no longer trigger the 'unidentified developer' Gatekeeper
warning.

- Import the Developer ID certificate from a base64 secret into a
  throwaway keychain and derive the signing identity automatically.
  Fall back to ad-hoc signing when the secret is absent (e.g. forks).
- Sign inside-out (helper binary, then app bundle) with hardened
  runtime, entitlements, and a secure timestamp.
- Notarize and staple the .app itself, not just the DMG, so Gatekeeper
  approves it on first launch even with Wi-Fi off (Wisp is offline-first).
- Notarize and staple the DMG as well.

Requires new repository secrets: MACOS_CERTIFICATE_P12_BASE64,
MACOS_CERTIFICATE_PASSWORD, APPLE_NOTARY_KEY_ID, APPLE_NOTARY_ISSUER_ID,
APPLE_NOTARY_KEY_P8_BASE64.
@pranc1ngpegasus
pranc1ngpegasus marked this pull request as ready for review August 2, 2026 16:05
@pranc1ngpegasus
pranc1ngpegasus merged commit 1c34c34 into main Aug 2, 2026
4 checks passed
@pranc1ngpegasus
pranc1ngpegasus deleted the ci/developer-id-signing-notarization branch August 2, 2026 16:06
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