Skip to content

Commit f6e38c2

Browse files
committed
Use standard macOS release tools
1 parent e5d63bd commit f6e38c2

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ scripts/build_app.sh
6464
codesign --verify --deep --strict --verbose=2 \
6565
"dist/Hardware Controller.app"
6666
codesign -dv --verbose=4 "dist/Hardware Controller.app" 2>&1 \
67-
| rg '^Authority='
67+
| grep -E '^Authority='
6868
codesign -dv --verbose=4 "dist/Hardware Controller.app" 2>&1 \
69-
| rg "^TeamIdentifier=${HC_EXPECTED_TEAM_ID}$"
69+
| grep -E "^TeamIdentifier=${HC_EXPECTED_TEAM_ID}$"
7070
```
7171

7272
Never commit `.env.local`. Quit the running app before replacing the single

scripts/build_release.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ verify_entitlements() {
7070
local key_count
7171
key_count="$(
7272
plutil -p "$entitlement_file" \
73-
| rg -c '^\s+"[^"]+" =>'
73+
| grep -Ec '^[[:space:]]+"[^"]+" =>'
7474
)"
7575
[[ "$key_count" == "1" ]] \
7676
|| release_fail "the app must contain exactly one entitlement."
@@ -89,10 +89,10 @@ verify_binary_policy() {
8989
signature_details="$(codesign -d --verbose=4 "$app_bundle" 2>&1)"
9090

9191
print -r -- "$signature_details" \
92-
| rg -q '^Identifier=com\.longdevity\.hardwarecontroller$' \
92+
| grep -Eq '^Identifier=com\.longdevity\.hardwarecontroller$' \
9393
|| release_fail "the signed bundle identifier is unexpected."
9494
print -r -- "$signature_details" \
95-
| rg -q '^CodeDirectory .*flags=.*\(runtime\)' \
95+
| grep -Eq '^CodeDirectory .*flags=.*\(runtime\)' \
9696
|| release_fail "hardened runtime is not enabled."
9797
local team_identifier
9898
team_identifier="$(
@@ -107,7 +107,7 @@ verify_binary_policy() {
107107
unexpected_libraries="$(
108108
otool -L "$binary" \
109109
| awk 'NR > 1 {print $1}' \
110-
| rg -v '^(/System/Library/|/usr/lib/)' \
110+
| grep -Ev '^(/System/Library/|/usr/lib/)' \
111111
|| true
112112
)"
113113
[[ -z "$unexpected_libraries" ]] \
@@ -274,11 +274,11 @@ main() {
274274
)" == "$build_number" ]] \
275275
|| release_fail "the app build number differs from packaging."
276276
file "$app_bundle/Contents/MacOS/HardwareController" \
277-
| rg -q 'Mach-O 64-bit executable arm64' \
277+
| grep -Fq 'Mach-O 64-bit executable arm64' \
278278
|| release_fail "the executable is not thin arm64."
279279
otool -l "$app_bundle/Contents/MacOS/HardwareController" \
280-
| rg -A4 'LC_BUILD_VERSION' \
281-
| rg -q 'minos 15\.0' \
280+
| grep -A 4 'LC_BUILD_VERSION' \
281+
| grep -Eq 'minos 15\.0' \
282282
|| release_fail "the executable minimum is not macOS 15.0."
283283

284284
verify_disk_image_contents "$dmg_path" "$app_bundle"

scripts/notarize_release.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ public_release_fail() {
1515
verify_developer_id_authority() {
1616
local signature_details="$1"
1717
print -r -- "$signature_details" \
18-
| rg -q '^Authority=Developer ID Application:' \
18+
| grep -Eq '^Authority=Developer ID Application:' \
1919
|| public_release_fail "the app is not signed with Developer ID Application."
2020
print -r -- "$signature_details" \
21-
| rg -q '^Timestamp=' \
21+
| grep -Eq '^Timestamp=' \
2222
|| public_release_fail "the Developer ID signature has no secure timestamp."
2323
}
2424

@@ -59,11 +59,11 @@ main() {
5959
|| public_release_fail "release evidence is missing."
6060
local source_commit
6161
source_commit="$(git rev-parse HEAD)"
62-
rg -Fq "| Source commit | \`$source_commit\` |" "$evidence_path" \
62+
grep -Fq "| Source commit | \`$source_commit\` |" "$evidence_path" \
6363
|| public_release_fail "release evidence does not match the current commit."
64-
rg -Fq "| Marketing version | $release_version |" "$evidence_path" \
64+
grep -Fq "| Marketing version | $release_version |" "$evidence_path" \
6565
|| public_release_fail "release evidence does not match the approved version."
66-
! rg -q '^## Notarization evidence$' "$evidence_path" \
66+
! grep -Eq '^## Notarization evidence$' "$evidence_path" \
6767
|| public_release_fail "notarization evidence already exists."
6868

6969
codesign --verify --deep --strict --verbose=2 "$app_bundle"

0 commit comments

Comments
 (0)