Skip to content

Commit 50ca0c2

Browse files
committed
Add macOS .icns app icon to DMG workflow
1 parent 3a9d57a commit 50ca0c2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/macos-dmg.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,25 @@ jobs:
163163
fi
164164
ls -la "$RES" || true
165165
166+
# 2b) Build macOS .icns app icon from our 512px PNG
167+
ICON_SRC="data/media/icon_512.png"
168+
if [ -f "$ICON_SRC" ]; then
169+
ICONSET_DIR="macos/Icon.iconset"
170+
rm -rf "$ICONSET_DIR"
171+
mkdir -p "$ICONSET_DIR"
172+
for sz in 16 32 64 128 256 512; do
173+
sips -s format png "$ICON_SRC" --resampleWidth $sz --out "$ICONSET_DIR/icon_${sz}x${sz}.png" >/dev/null
174+
done
175+
# @2x variants
176+
for sz in 16 32 128 256; do
177+
db=$(($sz*2))
178+
sips -s format png "$ICON_SRC" --resampleWidth $db --out "$ICONSET_DIR/icon_${sz}x${sz}@2x.png" >/dev/null
179+
done
180+
iconutil -c icns "$ICONSET_DIR" -o "$RES/SSHStudio.icns"
181+
else
182+
echo "WARN: Icon source $ICON_SRC not found; bundle will lack .icns" >&2
183+
fi
184+
166185
# 3) Vendor Python.framework
167186
BREW_PREFIX="$(brew --prefix)"
168187
# Dereference symlinks so the framework is self-contained inside the app bundle
@@ -271,6 +290,7 @@ jobs:
271290
<key>CFBundleIdentifier</key><string>io.github.BuddySirJava.SSH-Studio</string>
272291
<key>CFBundleName</key><string>SSH Studio</string>
273292
<key>CFBundleExecutable</key><string>ssh-studio</string>
293+
<key>CFBundleIconFile</key><string>SSHStudio</string>
274294
<key>CFBundlePackageType</key><string>APPL</string>
275295
<key>LSMinimumSystemVersion</key><string>11.0</string>
276296
</dict></plist>

0 commit comments

Comments
 (0)