Skip to content

Commit 8db27a7

Browse files
committed
feat: add icon fallback for CI builds
- Keeps IconComposer for modern macOS builds - Falls back to AppIcon.appiconset when IconComposer not available - Uses actool to compile AppIcon.appiconset in CI - Copies result to TaskitoIconComposer.icns location - Tested locally - actool successfully generates valid .icns
1 parent 1a0f268 commit 8db27a7

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/build-macos.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,43 @@ jobs:
4747
- name: Verify App Existence
4848
run: ls -la build/Build/Products/Release/
4949

50+
- name: Generate Icon Fallback
51+
run: |
52+
ICON_NAME=$(grep -A1 "ASSETCATALOG_COMPILER_APPICON_NAME" Taskito.xcodeproj/project.pbxproj | grep "=" | head -1 | sed 's/.*= "\(.*\)";/\1/')
53+
ICON_PATH="build/Build/Products/Release/Taskito.app/Contents/Resources/${ICON_NAME}.icns"
54+
55+
echo "🔍 Checking for icon: ${ICON_NAME}.icns"
56+
57+
if [ ! -f "$ICON_PATH" ]; then
58+
echo "⚠️ Icon not found. Building AppIcon.appiconset as fallback..."
59+
60+
# Temporarily change to AppIcon, build assets only
61+
sed -i '' 's/ASSETCATALOG_COMPILER_APPICON_NAME = TaskitoIconComposer;/ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;/' Taskito.xcodeproj/project.pbxproj
62+
63+
# Compile asset catalog with AppIcon
64+
xcrun actool Taskito/Assets.xcassets \
65+
--compile build/FallbackIcon \
66+
--platform macosx \
67+
--minimum-deployment-target 14.2 \
68+
--app-icon AppIcon \
69+
--output-partial-info-plist /tmp/partial.plist
70+
71+
# Restore original configuration
72+
sed -i '' 's/ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;/ASSETCATALOG_COMPILER_APPICON_NAME = TaskitoIconComposer;/' Taskito.xcodeproj/project.pbxproj
73+
74+
# Copy generated icon to expected location
75+
FALLBACK_ICON="build/FallbackIcon/AppIcon.icns"
76+
if [ -f "$FALLBACK_ICON" ]; then
77+
cp "$FALLBACK_ICON" "$ICON_PATH"
78+
echo "✅ Fallback icon generated and copied successfully"
79+
else
80+
echo "❌ Failed to generate fallback icon"
81+
exit 1
82+
fi
83+
else
84+
echo "✅ Icon found at: $ICON_PATH"
85+
fi
86+
5087
- name: Verify App Bundle Contents
5188
run: |
5289
echo "📦 Checking app bundle structure..."

0 commit comments

Comments
 (0)