Fix: Create .app bundle manually for SPM project
This commit is contained in:
parent
99e9efabd4
commit
0d283c3dec
79
.github/workflows/build-release.yml
vendored
79
.github/workflows/build-release.yml
vendored
|
|
@ -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
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>iDither</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.ewengadonnaud.iDither</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>iDither</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${{ github.ref_name }}</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>14.0</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue