Skip to content

Commit 07ec9c7

Browse files
committed
fix: correct icon name extraction and create output directory
- Fixed sed pattern to properly extract icon name - Create build/FallbackIcon directory before actool runs - Added diagnostic output to debug actool behavior - Removed unnecessary project file modifications
1 parent 8db27a7 commit 07ec9c7

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/build-macos.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@ jobs:
4949

5050
- name: Generate Icon Fallback
5151
run: |
52-
ICON_NAME=$(grep -A1 "ASSETCATALOG_COMPILER_APPICON_NAME" Taskito.xcodeproj/project.pbxproj | grep "=" | head -1 | sed 's/.*= "\(.*\)";/\1/')
52+
ICON_NAME=$(grep "ASSETCATALOG_COMPILER_APPICON_NAME" Taskito.xcodeproj/project.pbxproj | head -1 | sed 's/.*= //;s/;//' | tr -d ' ')
5353
ICON_PATH="build/Build/Products/Release/Taskito.app/Contents/Resources/${ICON_NAME}.icns"
5454
5555
echo "🔍 Checking for icon: ${ICON_NAME}.icns"
56+
echo "📁 Icon path: ${ICON_PATH}"
5657
5758
if [ ! -f "$ICON_PATH" ]; then
5859
echo "⚠️ Icon not found. Building AppIcon.appiconset as fallback..."
5960
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
61+
# Create output directory
62+
mkdir -p build/FallbackIcon
6263
6364
# Compile asset catalog with AppIcon
6465
xcrun actool Taskito/Assets.xcassets \
@@ -68,16 +69,18 @@ jobs:
6869
--app-icon AppIcon \
6970
--output-partial-info-plist /tmp/partial.plist
7071
71-
# Restore original configuration
72-
sed -i '' 's/ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;/ASSETCATALOG_COMPILER_APPICON_NAME = TaskitoIconComposer;/' Taskito.xcodeproj/project.pbxproj
72+
echo "📦 Checking actool output:"
73+
ls -la build/FallbackIcon/ || echo "Directory is empty"
7374
7475
# Copy generated icon to expected location
7576
FALLBACK_ICON="build/FallbackIcon/AppIcon.icns"
7677
if [ -f "$FALLBACK_ICON" ]; then
7778
cp "$FALLBACK_ICON" "$ICON_PATH"
7879
echo "✅ Fallback icon generated and copied successfully"
80+
ls -lh "$ICON_PATH"
7981
else
8082
echo "❌ Failed to generate fallback icon"
83+
echo "❌ Expected file not found at: $FALLBACK_ICON"
8184
exit 1
8285
fi
8386
else

0 commit comments

Comments
 (0)