chore: singing

This commit is contained in:
Yuriy Panov committed 2026-10-15 18:15:27 +06:00
1 parent 60156aba94
commit c85f5785fd
2 files changed
+17 -7

No files matched your search

+12 -4
View File
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
# Builds Musyx.app (release, ad-hoc signed) into target/release/bundle/.
# Builds Musyx.app (release, Developer ID signed) into target/release/bundle/.
# tool/bundle-macos.sh # build the bundle
# tool/bundle-macos.sh --install # and copy it to /Applications
# MUSYX_SIGN_IDENTITY picks another signing identity; "-" signs ad hoc.
set -euo pipefail
root="$(cd "$(dirname "$0")/.." && pwd)"
@@ -9,6 +10,7 @@ cd "$root"
version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)"
bundle="target/release/bundle/Musyx.app"
identity="${MUSYX_SIGN_IDENTITY:-Developer ID Application: Yuriy Panov (H33L24BGUH)}"
cargo build --release -p musyx
@@ -48,9 +50,15 @@ cat > "$bundle/Contents/Info.plist" <<PLIST
</plist>
PLIST
# Ad-hoc signature: enough to run locally. Each new build is a new identity to the
# keychain, so macOS may ask once to allow access to the saved sign-in.
codesign --force --deep --sign - "$bundle"
# Developer ID with the hardened runtime and a secure timestamp, as notarization requires.
# The identity stays the same across builds, so keychain access to the saved sign-in is
# granted once. An ad-hoc signature is a new identity on every build.
if [[ "$identity" == "-" ]]; then
codesign --force --sign - "$bundle"
else
codesign --force --options runtime --timestamp --sign "$identity" "$bundle"
fi
codesign --verify --strict --verbose=2 "$bundle"
echo "Built $bundle ($version)"
if [[ "${1:-}" == "--install" ]]; then