Repository Public
1#!/usr/bin/env bash2# ORIX Sonata3# File: Scripts/build-release.sh4# Description: Reproducible local release pipeline: tests, signed Release build, notarization of the app, DMG + ZIP, notarization of the DMG, Gatekeeper checks and SHA-256 checksums. Publishes nothing. Usage: build-release.sh [all|verify]5#6# Author: Simon-Pierre Boucher7# Contact: contact@spboucher.ai8set -euo pipefail9cd "$(dirname "$0")/.."10STEP="${1:-all}"11APP="dist/ORIX Sonata.app"12if [[ "$STEP" == "all" ]]; then13 cargo test --workspace --release 2>&1 | grep -E "^test result|FAILED" | sort | uniq -c14 Scripts/sign.sh15 Scripts/notarize.sh "$APP" app16 Scripts/package.sh17 VERSION="$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' "$APP/Contents/Info.plist")"18 Scripts/notarize.sh "dist/ORIX-Sonata-$VERSION.dmg" dmg19fi20VERSION="$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' "$APP/Contents/Info.plist")"21DMG="dist/ORIX-Sonata-$VERSION.dmg"; ZIP="dist/ORIX-Sonata-$VERSION.zip"22echo "== Gatekeeper"23spctl --assess --type execute --verbose=4 "$APP"24spctl --assess --type open --context context:primary-signature --verbose=4 "$DMG"25xcrun stapler validate "$APP"; xcrun stapler validate "$DMG"26(cd dist && shasum -a 256 "$(basename "$DMG")" "$(basename "$ZIP")" > SHA256SUMS.txt && cat SHA256SUMS.txt)27echo "RESULT: release artifacts are in dist/. Nothing was published."28