SPB Git

Repository Public License

release.sh 2.8 KB 46 lines shellscript

1#!/usr/bin/env bash2# ORIX OS Automation3# File: Scripts/release/release.sh4# Description: Full release: tests, Release build, secret scan, signature check, notarize the app, build and notarize the DMG, checksums, Gatekeeper verdict, evidence in docs/release/.5#6# Author: Simon-Pierre Boucher7# Contact: contact@spboucher.ai8#   Scripts/release/release.sh [--skip-tests]9# Uses the EXISTING notary keychain profile (NOTARY_PROFILE, default MacLustr-Notarize). Creates no credential.10set -euo pipefail11cd "$(dirname "$0")/../.."12APP="dist/ORIX OS Automation.app"13if [[ "${1:-}" != "--skip-tests" ]]; then Scripts/test/test-all.sh; fi14Scripts/check-headers.sh15Scripts/build/build.sh release16[[ -d "$APP" ]] || { echo "ERROR: release build did not produce $APP" >&2; exit 1; }17VERSION="$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' "$APP/Contents/Info.plist")"18BUILD="$(/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' "$APP/Contents/Info.plist")"19Scripts/release/secret-scan.sh "$APP" | tee build/secret-scan.txt20Scripts/release/sign.sh21Scripts/release/notarize.sh "$APP" app22Scripts/release/package.sh all23DMG="dist/ORIX-OS-Automation-$VERSION.dmg"24Scripts/release/notarize.sh "$DMG" dmg25Scripts/release/package.sh checksums26echo "== Gatekeeper"27spctl --assess --type execute -vv "$APP" 2>&1 | tee build/spctl-app.txt28spctl --assess --type open --context context:primary-signature -vv "$DMG" 2>&1 | tee build/spctl-dmg.txt29EVIDENCE="docs/release/release-$VERSION-$BUILD.md"30{31  echo "<!--"; echo "ORIX OS Automation"; echo "File: $EVIDENCE"; echo "Author: Simon-Pierre Boucher"; echo "Contact: contact@spboucher.ai"; echo "-->"32  echo "# Release evidence — $VERSION ($BUILD)"; echo33  echo "Generated by \`Scripts/release/release.sh\` on $(date -u +%Y-%m-%dT%H:%M:%SZ). Nothing below is typed by hand."; echo34  echo "## Secret scan"; echo '```'; cat build/secret-scan.txt; echo '```'35  echo "## Signature"; echo '```'; codesign -dvv "$APP" 2>&1 | grep -E "^(Identifier|Authority|TeamIdentifier|Timestamp|Runtime|Format|CodeDirectory)" ; echo '```'36  echo "## Architectures"; echo '```'; lipo -archs "$APP/Contents/MacOS/ORIX OS Automation"; echo '```'37  echo "## Entitlements"; echo '```'; codesign -d --entitlements - --xml "$APP" 2>/dev/null | plutil -p - 2>/dev/null || echo "none"; echo '```'38  echo "## Notarization"; echo '```'39  for n in app dmg; do /usr/bin/python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); print(sys.argv[2], d.get("id"), d.get("status"))' "build/notary/$n.json" "$n"; done40  echo '```'41  echo "## Staple"; echo '```'; xcrun stapler validate "$APP" 2>&1 | tail -1; xcrun stapler validate "$DMG" 2>&1 | tail -1; echo '```'42  echo "## Gatekeeper"; echo '```'; cat build/spctl-app.txt build/spctl-dmg.txt; echo '```'43  echo "## Checksums (SHA-256)"; echo '```'; cat dist/SHA256SUMS.txt; echo '```'44} > "$EVIDENCE"45echo "evidence: $EVIDENCE"46
Files main
Menu

Theme