From 0d283c3dec5491f950bef593916d06f1ccc6197b Mon Sep 17 00:00:00 2001 From: ewen Date: Thu, 15 Jan 2026 23:49:46 +0100 Subject: [PATCH] Fix: Create .app bundle manually for SPM project --- .github/workflows/build-release.yml | 79 +++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index b3ceee0..2d313c2 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -38,34 +38,91 @@ jobs: echo "🔍 Contenu de ./build/Build/Products/Release/ :" ls -la ./build/Build/Products/Release/ - - name: Create DMG + - name: Create App Bundle run: | - # Chemin exact pour Swift Package Manager - APP_PATH="./build/Build/Products/Release/iDither.app" + echo "📩 CrĂ©ation du bundle .app..." - if [ ! -d "$APP_PATH" ]; then - echo "❌ App non trouvĂ©e Ă  : $APP_PATH" - echo "🔍 Recherche alternative..." - find ./build -name "*.app" -type d + # Trouve l'exĂ©cutable compilĂ© + EXECUTABLE_PATH=$(find ./build/Build/Products/Release -name "iDither" -type f -perm +111 | head -n 1) + + if [ -z "$EXECUTABLE_PATH" ]; then + echo "❌ ExĂ©cutable non trouvĂ©" + echo "🔍 Contenu de Release:" + ls -la ./build/Build/Products/Release/ exit 1 fi - echo "✅ App trouvĂ©e : $APP_PATH" + echo "✅ ExĂ©cutable trouvĂ© : $EXECUTABLE_PATH" + + # CrĂ©e la structure du bundle .app + APP_DIR="./iDither.app" + mkdir -p "$APP_DIR/Contents/MacOS" + mkdir -p "$APP_DIR/Contents/Resources" + + # Copie l'exĂ©cutable + cp "$EXECUTABLE_PATH" "$APP_DIR/Contents/MacOS/iDither" + chmod +x "$APP_DIR/Contents/MacOS/iDither" + + # Copie les ressources (bundle SPM) + if [ -d "./build/Build/Products/Release/iDither_iDither.bundle" ]; then + cp -R "./build/Build/Products/Release/iDither_iDither.bundle" "$APP_DIR/Contents/Resources/" + echo "✅ Bundle de ressources copiĂ©" + fi + + # CrĂ©e Info.plist + cat > "$APP_DIR/Contents/Info.plist" << EOF + + + + + CFBundleExecutable + iDither + CFBundleIdentifier + com.ewengadonnaud.iDither + CFBundleName + iDither + CFBundlePackageType + APPL + CFBundleShortVersionString + ${{ github.ref_name }} + CFBundleVersion + 1 + LSMinimumSystemVersion + 14.0 + NSHighResolutionCapable + + + + EOF + + echo "✅ Bundle .app créé : $APP_DIR" + ls -la "$APP_DIR/Contents/MacOS/" + + - name: Create DMG + run: | + APP_PATH="./iDither.app" + + if [ ! -d "$APP_PATH" ]; then + echo "❌ Bundle .app non trouvĂ©" + exit 1 + fi + + echo "✅ CrĂ©ation du DMG depuis : $APP_PATH" # CrĂ©e un dossier temporaire pour le DMG mkdir -p dmg_content cp -R "$APP_PATH" dmg_content/ - # Ajoute un lien vers /Applications (drag & drop facile) + # Ajoute un lien vers /Applications ln -s /Applications dmg_content/Applications # CrĂ©e le DMG hdiutil create -volname "iDither" \ -srcfolder dmg_content \ -ov -format UDZO \ - iDither-${{ github.ref_name }}.dmg + "iDither-${{ github.ref_name }}.dmg" - echo "✅ DMG créé : iDither-${{ github.ref_name }}.dmg" + echo "✅ DMG créé :" ls -lh iDither-*.dmg - name: Create Release