Skip to content

Commit 6aa836b

Browse files
committed
fix: improve icon validation and diagnostics
- Validate icon exists AND is valid size (>1KB) - Fixed DMG icon name extraction (was using old broken pattern) - Added diagnostics to check Info.plist CFBundleIconFile - Show actual icon files found in Resources folder This should properly detect if IconComposer fails and use fallback
1 parent 07ec9c7 commit 6aa836b

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/build-macos.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,26 @@ jobs:
5555
echo "🔍 Checking for icon: ${ICON_NAME}.icns"
5656
echo "📁 Icon path: ${ICON_PATH}"
5757
58-
if [ ! -f "$ICON_PATH" ]; then
58+
# Check if icon exists and is valid
59+
ICON_VALID=false
60+
if [ -f "$ICON_PATH" ]; then
61+
echo "✅ Icon file exists"
62+
ls -lh "$ICON_PATH"
63+
file "$ICON_PATH"
64+
65+
# Verify it's a valid icns file (should be > 1KB and have correct magic bytes)
66+
ICON_SIZE=$(stat -f%z "$ICON_PATH" 2>/dev/null || echo "0")
67+
if [ "$ICON_SIZE" -gt 1000 ]; then
68+
echo "✅ Icon size looks good: ${ICON_SIZE} bytes"
69+
ICON_VALID=true
70+
else
71+
echo "⚠️ Icon file too small (${ICON_SIZE} bytes), treating as invalid"
72+
fi
73+
else
74+
echo "⚠️ Icon file not found"
75+
fi
76+
77+
if [ "$ICON_VALID" = false ]; then
5978
echo "⚠️ Icon not found. Building AppIcon.appiconset as fallback..."
6079
6180
# Create output directory
@@ -96,7 +115,10 @@ jobs:
96115
ls -la build/Build/Products/Release/Taskito.app/Contents/Resources/
97116
echo ""
98117
echo "🎨 Looking for icon files..."
99-
find build/Build/Products/Release/Taskito.app/Contents/Resources -name "*.icns" || echo "⚠️ No .icns files found!"
118+
find build/Build/Products/Release/Taskito.app/Contents/Resources -name "*.icns" -exec ls -lh {} \; || echo "⚠️ No .icns files found!"
119+
echo ""
120+
echo "📄 Checking Info.plist for icon reference..."
121+
/usr/libexec/PlistBuddy -c "Print :CFBundleIconFile" build/Build/Products/Release/Taskito.app/Contents/Info.plist || echo "⚠️ CFBundleIconFile not set"
100122
101123
- name: Install appdmg and fileicon
102124
run: |
@@ -113,7 +135,7 @@ jobs:
113135
- name: Set DMG Icon
114136
run: |
115137
# Extract the app icon name from the project file
116-
ICON_NAME=$(grep -A1 "ASSETCATALOG_COMPILER_APPICON_NAME" Taskito.xcodeproj/project.pbxproj | grep "=" | head -1 | sed 's/.*= "\(.*\)";/\1/')
138+
ICON_NAME=$(grep "ASSETCATALOG_COMPILER_APPICON_NAME" Taskito.xcodeproj/project.pbxproj | head -1 | sed 's/.*= //;s/;//' | tr -d ' ')
117139
ICON_PATH="build/Build/Products/Release/Taskito.app/Contents/Resources/${ICON_NAME}.icns"
118140
119141
echo "🎨 Looking for icon: ${ICON_NAME}.icns"

0 commit comments

Comments
 (0)