#!/bin/bash # Auteur : Simon-Pierre Boucher — contact@spboucher.ai # Compile l'exécutable SwiftPM et l'assemble en dist/KA.app (signature ad-hoc # pour l'itération locale ; scripts/notarize.sh fait la vraie signature). # Pipeline repris de forge-studio (scripts/package-app.sh). set -euo pipefail cd "$(dirname "$0")/.." CONFIG="${1:-release}" swift build -c "$CONFIG" BIN=".build/$CONFIG/KA" APP_DIR="dist/KA.app" rm -rf "$APP_DIR" mkdir -p "$APP_DIR/Contents/MacOS" "$APP_DIR/Contents/Resources" cp "$BIN" "$APP_DIR/Contents/MacOS/KA" if [ ! -f Assets/AppIcon.icns ]; then ./scripts/generate-icon.sh; fi cp Assets/AppIcon.icns "$APP_DIR/Contents/Resources/AppIcon.icns" # Bundle de ressources SwiftPM (logos des 13 marques) — requis par Bundle.module cp -R ".build/$CONFIG/KA_KA.bundle" "$APP_DIR/Contents/Resources/" cat > "$APP_DIR/Contents/Info.plist" <<'PLIST' CFBundleNameKA CFBundleDisplayNameKA CFBundleIdentifiercom.groupeka.ka.mac CFBundleExecutableKA CFBundleVersion3 CFBundleShortVersionString2.1.0 CFBundlePackageTypeAPPL LSMinimumSystemVersion14.0 LSApplicationCategoryTypepublic.app-category.lifestyle CFBundleIconFileAppIcon CFBundleDevelopmentRegionfr NSHighResolutionCapable NSHumanReadableCopyright© Simon-Pierre Boucher — Groupe KA PLIST codesign --force --deep --sign - "$APP_DIR" codesign --verify --deep --strict --verbose=2 "$APP_DIR" echo "OK : $APP_DIR"