SPB Git

Repository Public License

sign.sh 2.0 KB 28 lines shellscript

1#!/usr/bin/env bash2# ORIX Clean — Scripts/sign.sh3# Description: Builds the Release configuration (universal, Hardened Runtime), signed with the Developer ID Application4#              identity already in the keychain, and verifies the result. Produces dist/ORIX Clean.app. Uploads nothing.5# Author: Simon-Pierre Boucher — contact@spboucher.ai6set -euo pipefail7cd "$(dirname "$0")/.."8DD="build/DerivedData"9APP="dist/ORIX Clean.app"10security find-identity -v -p codesigning | grep -q "Developer ID Application" || { echo "ERROR: no Developer ID Application identity in the keychain." >&2; exit 1; }11python3 Scripts/localize.py && xcodegen generate --quiet12rm -rf "$DD/Build/Products/Release/ORIX Clean.app"13xcodebuild -project ORIXClean.xcodeproj -scheme ORIXClean -configuration Release -derivedDataPath "$DD" build 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | grep -E "error:|\*\* BUILD" | sort -u14BUILT="$DD/Build/Products/Release/ORIX Clean.app"15[[ -d "$BUILT" ]] || { echo "ERROR: Release build failed." >&2; exit 1; }16rm -rf dist && mkdir -p dist17ditto "$BUILT" "$APP"18echo "== verify"19codesign --verify --deep --strict --verbose=2 "$APP"20echo "architectures: $(lipo -archs "$APP/Contents/MacOS/ORIX Clean")"21codesign -dvv "$APP" 2>&1 | grep -E "^(Identifier|Authority|TeamIdentifier|Timestamp|Runtime Version)" | sed 's/^/  /'22FLAGS="$(codesign -dv "$APP" 2>&1 | sed -n 's/.*flags=\([^ ]*\).*/\1/p')"; echo "flags: $FLAGS"23[[ "$FLAGS" == *runtime* ]] || { echo "ERROR: Hardened Runtime is not enabled." >&2; exit 1; }24if codesign -d --entitlements - --xml "$APP" 2>/dev/null | grep -q "get-task-allow"; then echo "ERROR: get-task-allow present." >&2; exit 1; fi25echo "entitlements: $(codesign -d --entitlements - --xml "$APP" 2>/dev/null | plutil -convert json -o - - 2>/dev/null || echo '{}')"26echo "version: $(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' "$APP/Contents/Info.plist") ($(/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' "$APP/Contents/Info.plist"))"27echo "RESULT: $APP is built and signed. It is NOT notarized yet (Scripts/notarize.sh)."28
Files main
Menu

Theme