Repository Public
1<!--2ORIX Docs3File: docs/release/notarization.md4Description: How the application and the disk image are notarized and stapled, and the recorded result for version 1.0.0.5Author: Simon-Pierre Boucher6Contact: contact@spboucher.ai7-->8# Notarization910Source: [`Scripts/notarize.sh`](../../Scripts/notarize.sh). It runs after [`Scripts/release.sh`](../../Scripts/release.sh) ([signing.md](signing.md)) and needs a `notarytool` keychain profile that already exists on the maintainer's Mac.1112## Rules the script follows1314* It **never creates, prints or changes credentials**. The profile name comes from `NOTARY_PROFILE` (default `MacLustr-Notarize`), created beforehand with `xcrun notarytool store-credentials`.15* A submission counts as successful **only when Apple's answer has the status `Accepted`**. Any other status, or a refused upload, stops the script with a message that says exactly what is and is not notarized.16* The words "notarized by Apple" are printed only at the very end, after both submissions were accepted and both tickets stapled.1718## Steps1920| Step | Commands | On failure |21|---|---|---|22| 1. Submit the application | `ditto -c -k --keepParent "dist/ORIX Docs.app" build/notary/app.zip`, then `xcrun notarytool submit … --wait --output-format json`; the answer is saved to `build/notary/app.json`, the notary log to `build/notary/app-log.json` | Exit 2: "NOT notarized. … is signed but carries no notarization ticket." |23| 2. Staple the application | `xcrun stapler staple`, `xcrun stapler validate` | Script stops (`set -e`) |24| 3. ZIP of the stapled application | `ditto -c -k --keepParent` → `dist/ORIX-Docs-<version>.zip` | |25| 4. Disk image | `Scripts/package.sh` builds `dist/ORIX-Docs-<version>.dmg` ([distribution.md](distribution.md)); it is signed (`codesign --force --timestamp`), submitted like the application, then stapled and validated | Exit 3: "the app is notarized and stapled, the DMG is NOT." |26| 5. Gatekeeper and checksums | `spctl --assess --type execute` on the application; `spctl --assess --type open --context context:primary-signature` on the disk image; `shasum -a 256` of both artifacts into `dist/SHA256SUMS.txt`; everything gathered into `dist/release.json` | |2728The ZIP is created from the application **after** stapling, so the application inside it carries its ticket. A ZIP archive itself cannot be stapled.2930## Recorded result for version 1.0.0 (build 2)3132From `dist/release.json`. The `dist/` folder is ignored by git, so the facts are reproduced here.3334| Item | Submission id | Status |35|---|---|---|36| Application (`ORIX Docs.app`) | `5cbffb9c-d031-4702-81c6-ecb0d1068eca` | **Accepted** |37| Disk image (`ORIX-Docs-1.0.0.dmg`) | `794c8ee7-f0ef-491f-b7cc-7ab911771eca` | **Accepted** |3839Gatekeeper output recorded in the same file:4041```text42dist/ORIX Docs.app: accepted43 source=Notarized Developer ID4445dist/ORIX-Docs-1.0.0.dmg: accepted46 source=Notarized Developer ID47```4849Stapling: the script only reaches the step that writes `dist/release.json` after `stapler staple` and `stapler validate` succeeded for both items. `xcrun stapler validate "dist/ORIX Docs.app"` was run again on 2026-11-21 while writing this document and answered "The validate action worked!".5051## Checking a submission again5253The maintainer can ask Apple for the status or the log of a submission with the same profile:5455```sh56xcrun notarytool info 5cbffb9c-d031-4702-81c6-ecb0d1068eca --keychain-profile "$NOTARY_PROFILE"57xcrun notarytool log 794c8ee7-f0ef-491f-b7cc-7ab911771eca --keychain-profile "$NOTARY_PROFILE"58```5960Anyone can check the result without credentials:6162```sh63xcrun stapler validate "/Applications/ORIX Docs.app"64spctl --assess --type execute --verbose=2 "/Applications/ORIX Docs.app"65spctl --assess --type open --context context:primary-signature --verbose=2 ORIX-Docs-1.0.0.dmg66```6768## What is not covered6970* The notary logs (`build/notary/*-log.json`) are build products and are not committed; their content is not reproduced here.71* The first launch of a downloaded, quarantined copy was not exercised on a clean second Mac ([distribution.md](distribution.md#what-was-not-verified)). The Gatekeeper assessments above were made on the build machine.72* Notarization is Apple's automated check of the signed code. It is not a review of the application's behaviour.73