Files
hermes-agent/scripts
BearHuddleston b7f087e99f fix(ci): fail fast on invalid macOS notarization credentials before building
Canary runs 44784160658 and 44876973873 spent ~10 minutes building,
signing, and zipping Hermes Agent Canary.app before `xcrun notarytool
submit` failed in seconds with HTTP 401 Unauthenticated.

Add a pre-build credential preflight (`scripts/ci/check_macos_notary_auth.py`)
and wire it into `.github/workflows/desktop-bundled-release.yml` immediately
after `Write App Store Connect key for notarytool` on both darwin legs
(release and commit/channel, sharing `&darwin-steps`):

- Validates that `APPLE_API_KEY`, `APPLE_API_KEY_ID`, and
  `APPLE_API_ISSUER` are set and that `apple-api-key.p8` contains a single
  DER-encoded PKCS#8 PEM private key before invoking `xcrun`.
- Runs `xcrun notarytool history --key ... --key-id ... --issuer ...
  --output-format json` with a 30 s timeout and redacts key IDs, issuer
  UUIDs, and PEM blocks from any logged output.
- Fails fast (exit 1, `::error::`) only on deterministic credential errors:
  HTTP 401/403 (revoked key, wrong role, expired/missing Apple legal
  agreements), invalid PEM, or local `notarytool` key/argument errors.
- Treats transient Apple failures (HTTP 5xx/429 including Apple's HTTP 500
  "Error communicating with authentication service", `NSURLErrorDomain`
  lost-contact errors, subprocess timeouts, `OSError`, and unrecognized
  non-zero exits) as non-fatal warnings (`:⚠️:`, exit 0) so
  `Build and package` keeps its full retry path and post-build Gatekeeper
  verification.
- On channel builds, prefers `.build/channel-controller` (the trusted main
  checkout); on older `build_commit` checkouts lacking the helper, warns
  and skips while release checkouts fail closed.
2026-11-21 22:59:02 +00:00
..
…