Skip to content

Commit 426c7d8

Browse files
authored
fix(ci): sign macOS builds with release environment credentials (#59760)
1 parent 6abf95b commit 426c7d8

3 files changed

Lines changed: 15 additions & 13 deletions

File tree

‎.github/release/sign-desktop-macos.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# notarizes them in one submission, staples them, and only then builds opencode-desktop-mac-<arch>.{zip,dmg,app.tar.gz}
44
# from the stapled apps. Dry runs sign ad-hoc and skip notarization. Dev and beta trade larger files for faster
55
# packaging (zip and dmg at zlib level 1) and skip the .app.tar.gz, which only the retired Tauri updater feed read.
6-
# Notarization reads APPLE_API_KEY_CONTENT, APPLE_API_KEY_ID and APPLE_API_ISSUER.
6+
# Notarization reads APPLE_NOTARY_KEY (the .p8 contents), APPLE_NOTARY_KEY_ID and APPLE_NOTARY_ISSUER_ID.
77
. "$(dirname "$0")/lib.sh"
88

99
out=$1
@@ -60,9 +60,9 @@ done
6060

6161
if ! dry_run; then
6262
key=$(mktemp)
63-
printf '%s\n' "$APPLE_API_KEY_CONTENT" > "$key"
63+
printf '%s\n' "$APPLE_NOTARY_KEY" > "$key"
6464
ditto -c -k --sequesterRsrc "$apps" "$apps.zip"
65-
xcrun notarytool submit "$apps.zip" --key "$key" --key-id "$APPLE_API_KEY_ID" --issuer "$APPLE_API_ISSUER" \
65+
xcrun notarytool submit "$apps.zip" --key "$key" --key-id "$APPLE_NOTARY_KEY_ID" --issuer "$APPLE_NOTARY_ISSUER_ID" \
6666
--wait --timeout 60m --output-format json > "$apps.json"
6767
rm -f "$key"
6868
cat "$apps.json"

‎.github/workflows/release-dry-run.yml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,9 @@ jobs:
385385
uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0
386386
with:
387387
keychain: build
388-
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
389-
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
388+
p12-file-base64: ${{ secrets.APPLE_SIGNING_CERTIFICATE }}
389+
# The certificate has no password; the action passes this to `security import -P`.
390+
p12-password: ""
390391
- name: Sign CLI
391392
if: needs.plan.outputs.cli == 'true'
392393
run: bash .github/release/sign-cli-macos.sh "$RUNNER_TEMP/in/build-npm" "$RUNNER_TEMP/out"
@@ -396,9 +397,9 @@ jobs:
396397
bash .github/release/sign-desktop-macos.sh "$RUNNER_TEMP/out" \
397398
"$RUNNER_TEMP"/in/build-desktop-darwin-*/opencode-desktop-mac-*.app.tar
398399
env:
399-
APPLE_API_KEY_CONTENT: ${{ secrets.APPLE_API_KEY_PATH }}
400-
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY }}
401-
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
400+
APPLE_NOTARY_KEY: ${{ secrets.APPLE_NOTARY_KEY }}
401+
APPLE_NOTARY_KEY_ID: ${{ vars.APPLE_NOTARY_KEY_ID }}
402+
APPLE_NOTARY_ISSUER_ID: ${{ vars.APPLE_NOTARY_ISSUER_ID }}
402403
- id: upload
403404
name: Upload
404405
uses: ./.github/release/upload

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,9 @@ jobs:
404404
uses: apple-actions/import-codesign-certs@8f3fb608891dd2244cdab3d69cd68c0d37a7fe93 # v2.0.0
405405
with:
406406
keychain: build
407-
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
408-
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
407+
p12-file-base64: ${{ secrets.APPLE_SIGNING_CERTIFICATE }}
408+
# The certificate has no password; the action passes this to `security import -P`.
409+
p12-password: ""
409410
- name: Sign CLI
410411
if: needs.plan.outputs.cli == 'true'
411412
run: bash .github/release/sign-cli-macos.sh "$RUNNER_TEMP/in/build-npm" "$RUNNER_TEMP/out"
@@ -415,9 +416,9 @@ jobs:
415416
bash .github/release/sign-desktop-macos.sh "$RUNNER_TEMP/out" \
416417
"$RUNNER_TEMP"/in/build-desktop-darwin-*/opencode-desktop-mac-*.app.tar
417418
env:
418-
APPLE_API_KEY_CONTENT: ${{ secrets.APPLE_API_KEY_PATH }}
419-
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY }}
420-
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
419+
APPLE_NOTARY_KEY: ${{ secrets.APPLE_NOTARY_KEY }}
420+
APPLE_NOTARY_KEY_ID: ${{ vars.APPLE_NOTARY_KEY_ID }}
421+
APPLE_NOTARY_ISSUER_ID: ${{ vars.APPLE_NOTARY_ISSUER_ID }}
421422
- id: upload
422423
name: Upload
423424
uses: ./.github/release/upload

0 commit comments

Comments
 (0)