1#!/bin/bash2# Auteur : Simon-Pierre Boucher — contact@spboucher.ai3# Compile l'exécutable SwiftPM et l'assemble en dist/KA.app (signature ad-hoc4# pour l'itération locale ; scripts/notarize.sh fait la vraie signature).5# Pipeline repris de forge-studio (scripts/package-app.sh).6set -euo pipefail7cd "$(dirname "$0")/.."89CONFIG="${1:-release}"10swift build -c "$CONFIG"1112BIN=".build/$CONFIG/KA"13APP_DIR="dist/KA.app"14rm -rf "$APP_DIR"15mkdir -p "$APP_DIR/Contents/MacOS" "$APP_DIR/Contents/Resources"1617cp "$BIN" "$APP_DIR/Contents/MacOS/KA"18if [ ! -f Assets/AppIcon.icns ]; then ./scripts/generate-icon.sh; fi19cp Assets/AppIcon.icns "$APP_DIR/Contents/Resources/AppIcon.icns"2021cat > "$APP_DIR/Contents/Info.plist" <<'PLIST'22<?xml version="1.0" encoding="UTF-8"?>23<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">24<plist version="1.0">25<dict>26 <key>CFBundleName</key><string>KA</string>27 <key>CFBundleDisplayName</key><string>KA</string>28 <key>CFBundleIdentifier</key><string>com.groupeka.ka.mac</string>29 <key>CFBundleExecutable</key><string>KA</string>30 <key>CFBundleVersion</key><string>1</string>31 <key>CFBundleShortVersionString</key><string>1.0.0</string>32 <key>CFBundlePackageType</key><string>APPL</string>33 <key>LSMinimumSystemVersion</key><string>14.0</string>34 <key>LSApplicationCategoryType</key><string>public.app-category.lifestyle</string>35 <key>CFBundleIconFile</key><string>AppIcon</string>36 <key>CFBundleDevelopmentRegion</key><string>fr</string>37 <key>NSHighResolutionCapable</key><true/>38 <key>NSHumanReadableCopyright</key><string>© Simon-Pierre Boucher — Groupe KA</string>39</dict>40</plist>41PLIST4243codesign --force --deep --sign - "$APP_DIR"44codesign --verify --deep --strict --verbose=2 "$APP_DIR"45echo "OK : $APP_DIR"46