#!/usr/bin/env bash set -e APP_NAME="SpotXInstaller" RID="osx-x64" ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" OUTPUT_DIR="$ROOT/bin/Release/net10.0/$RID/publish" ZIP_DIR="$ROOT/bin/Release/net10.0/$RID" ZIP_FILE="$ZIP_DIR/$APP_NAME-macOS-x64.zip" echo echo "========================================" echo " Building SpotXInstaller macOS" echo "========================================" echo echo "[1/4] Cleaning..." rm -rf "$OUTPUT_DIR" rm -f "$ZIP_FILE" mkdir -p "$ZIP_DIR" echo echo "[2/4] Publishing macOS Intel..." dotnet publish "$ROOT/SpotXInstaller.csproj" \ -c Release \ -r "$RID" \ --self-contained true \ -p:PublishSingleFile=false \ -p:IncludeNativeLibrariesForSelfExtract=false \ -p:DebugType=None \ -p:DebugSymbols=false \ -o "$OUTPUT_DIR" echo echo "[3/4] Creating ZIP..." cd "$OUTPUT_DIR" zip -r "$ZIP_FILE" . \ -x "*.pdb" cd "$ROOT" echo echo "[4/4] Checking output..." if [ ! -f "$ZIP_FILE" ]; then echo echo "ERROR: macOS ZIP was not created." exit 1 fi echo echo "========================================" echo " MACOS BUILD COMPLETE" echo "========================================" echo echo "ZIP:" echo "$ZIP_FILE" echo ls -lh "$ZIP_FILE" echo