Skip to content

Commit 578de55

Browse files
committed
chore: move notarization config to local env
1 parent deff661 commit 578de55

3 files changed

Lines changed: 22 additions & 10 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
/.pi-subagents/
44
/.kit/
55
/.kit-codesign-identity
6+
/.env
67
.DS_Store

docs/releasing.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ mise use github:danielkov/kit-releases@0.1.29-pre
4848
## Prepare a signed macOS release locally
4949

5050
Run signing and notarization on a trusted macOS machine so Apple queue delays do
51-
not consume metered GitHub-hosted macOS runner time. The script reads the App
52-
Store Connect API key from 1Password, uses the installed Developer ID identity,
53-
and preserves the exact submitted binary under `dist/notarize/`:
51+
not consume metered GitHub-hosted macOS runner time. Set
52+
`KIT_NOTARY_API_KEY_DOCUMENT`, `KIT_NOTARY_API_KEY_VAULT`,
53+
`KIT_NOTARY_API_KEY_ID`, and `KIT_NOTARY_API_ISSUER_ID` in the ignored repository
54+
root `.env` file or export them in the release environment. The script loads
55+
`.env` when present, reads the App Store Connect API key from 1Password, uses the
56+
installed Developer ID identity, and preserves the exact submitted binary under
57+
`dist/notarize/`:
5458

5559
```sh
5660
caffeinate -i scripts/notarize-release.sh v0.1.29

scripts/notarize-release.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ Usage: scripts/notarize-release.sh vVERSION
88
Builds, Developer ID signs, and notarizes the macOS ARM64 release binary on
99
this Mac. The exact signed binary is preserved under dist/notarize/vVERSION/.
1010
11-
Configuration can be overridden with:
12-
KIT_CODESIGN_IDENTITY
13-
KIT_CODESIGN_IDENTIFIER
11+
Required configuration (`.env` or environment variables):
1412
KIT_NOTARY_API_KEY_DOCUMENT
1513
KIT_NOTARY_API_KEY_VAULT
1614
KIT_NOTARY_API_KEY_ID
1715
KIT_NOTARY_API_ISSUER_ID
16+
17+
Optional overrides:
18+
KIT_CODESIGN_IDENTITY
19+
KIT_CODESIGN_IDENTIFIER
1820
EOF
1921
}
2022

@@ -38,6 +40,11 @@ fi
3840
root=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
3941
cd "$root"
4042

43+
if [[ -f $root/.env ]]; then
44+
# shellcheck source=/dev/null
45+
source "$root/.env"
46+
fi
47+
4148
tag=$1
4249
version=${tag#v}
4350
cargo_version=$(sed -n 's/^version = "\([^"]*\)"/\1/p' Cargo.toml | head -1)
@@ -52,10 +59,10 @@ fi
5259

5360
identity=${KIT_CODESIGN_IDENTITY:-Developer ID Application: Inlucent Limited (TAMRUK8SL6)}
5461
identifier=${KIT_CODESIGN_IDENTIFIER:-com.danielkov.kit}
55-
api_key_document=${KIT_NOTARY_API_KEY_DOCUMENT:-AuthKey_ZMYQG5BF8G}
56-
api_key_vault=${KIT_NOTARY_API_KEY_VAULT:-Employee}
57-
api_key_id=${KIT_NOTARY_API_KEY_ID:-ZMYQG5BF8G}
58-
api_issuer_id=${KIT_NOTARY_API_ISSUER_ID:-1de533ad-a88e-4de7-a5a4-d04a4722af91}
62+
api_key_document=${KIT_NOTARY_API_KEY_DOCUMENT:?KIT_NOTARY_API_KEY_DOCUMENT must be set}
63+
api_key_vault=${KIT_NOTARY_API_KEY_VAULT:?KIT_NOTARY_API_KEY_VAULT must be set}
64+
api_key_id=${KIT_NOTARY_API_KEY_ID:?KIT_NOTARY_API_KEY_ID must be set}
65+
api_issuer_id=${KIT_NOTARY_API_ISSUER_ID:?KIT_NOTARY_API_ISSUER_ID must be set}
5966
target=aarch64-apple-darwin
6067
commit=$(git rev-parse HEAD)
6168
out_dir="$root/dist/notarize/$tag"

0 commit comments

Comments
 (0)