-
Notifications
You must be signed in to change notification settings - Fork 36
ci: restore arm64 releases and harden macOS release signing #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mchv
wants to merge
7
commits into
justrach:main
Choose a base branch
from
mchv:fix/release-followup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+128
−30
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3c85595
ci: restore arm64 releases and notarize macOS builds
mchv e454c72
ci: scope Apple secrets to macOS steps
mchv a97a29f
ci: keep existing Apple cert secret names
mchv e78f096
ci: support legacy tags in macOS release job
mchv 14bf78b
ci: use Apple action for codesign cert import
mchv 902cdf9
ci: move notarization logic into script
mchv cdf459f
ci: fetch notarization helper for legacy tags
mchv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| if [[ $# -ne 1 ]]; then | ||
| echo "usage: $0 <binary-path>" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| binary_path="$1" | ||
|
|
||
| : "${APPLE_API_KEY_ID:?APPLE_API_KEY_ID is required}" | ||
| : "${APPLE_API_ISSUER_ID:?APPLE_API_ISSUER_ID is required}" | ||
| : "${APPLE_API_KEY_BASE64:?APPLE_API_KEY_BASE64 is required}" | ||
|
|
||
| tmp_dir="$(mktemp -d "${TMPDIR:-/tmp}/codedb-notary.XXXXXX")" | ||
| api_key_path="$tmp_dir/codedb-notary-key.p8" | ||
| zip_path="$tmp_dir/$(basename "$binary_path").zip" | ||
| export API_KEY_PATH="$api_key_path" | ||
|
|
||
| cleanup() { | ||
| rm -rf "$tmp_dir" | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| python3 - <<'PY' | ||
| import base64 | ||
| import os | ||
| import pathlib | ||
|
|
||
| pathlib.Path(os.environ["API_KEY_PATH"]).write_bytes( | ||
| base64.b64decode(os.environ["APPLE_API_KEY_BASE64"]) | ||
| ) | ||
| PY | ||
|
|
||
| chmod 600 "$api_key_path" | ||
| codesign --verify --verbose=2 "$binary_path" | ||
| ditto -c -k --keepParent "$binary_path" "$zip_path" | ||
| xcrun notarytool submit "$zip_path" \ | ||
| --key "$api_key_path" \ | ||
| --key-id "$APPLE_API_KEY_ID" \ | ||
| --issuer "$APPLE_API_ISSUER_ID" \ | ||
| --wait | ||
| xcrun stapler staple "$binary_path" || true | ||
| spctl --assess --type execute --verbose=4 "$binary_path" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step pulls
scripts/notarize-macos.shfrom a mutable branch tip and that script is later executed in the notarization step withAPPLE_API_*secrets, so historical tag rebuilds can run different code than what was reviewed for the tag. If default-branch content changes (accidentally or maliciously), the workflow can leak notarization credentials or alter signing behavior without any change to the release tag being rebuilt. Use an immutable ref (for example, a specific commit SHA tied to the workflow revision) before executing the helper with secrets.Useful? React with 👍 / 👎.