#!/bin/bash # Author: Simon-Pierre Boucher — contact@spboucher.ai # Build the SwiftPM executable and wrap it into ForgeStudio.app (ad-hoc # signed — fast local iteration; scripts/notarize.sh does the real signing). set -euo pipefail cd "$(dirname "$0")/.." CONFIG="${1:-release}" swift build -c "$CONFIG" BIN=".build/$CONFIG/ForgeStudio" APP_DIR="dist/ForgeStudio.app" rm -rf "$APP_DIR" mkdir -p "$APP_DIR/Contents/MacOS" "$APP_DIR/Contents/Resources" cp "$BIN" "$APP_DIR/Contents/MacOS/ForgeStudio" if [ ! -f Assets/AppIcon.icns ]; then ./scripts/generate-icon.sh; fi cp Assets/AppIcon.icns "$APP_DIR/Contents/Resources/AppIcon.icns" cat > "$APP_DIR/Contents/Info.plist" <<'PLIST' CFBundleNameForge Studio CFBundleDisplayNameForge Studio CFBundleIdentifierai.spboucher.forge-studio CFBundleExecutableForgeStudio CFBundleVersion1 CFBundleShortVersionString0.2.0 CFBundlePackageTypeAPPL LSMinimumSystemVersion14.0 LSApplicationCategoryTypepublic.app-category.developer-tools CFBundleIconFileAppIcon NSHighResolutionCapable NSHumanReadableCopyright© Simon-Pierre Boucher PLIST codesign --force --deep --sign - "$APP_DIR" codesign --verify --deep --strict --verbose=2 "$APP_DIR" echo "OK: $APP_DIR"