feat(bar): bundle a macOS app icon

Generate AppIcon.icns from the CCS mark at package time (sips + iconutil)
and reference it via CFBundleIconFile so Finder, Spotlight, and the Dock
show the brand icon instead of a blank bundle.

Refs #1525
This commit is contained in:
Tam Nhu Tran
2026-06-15 17:13:36 -04:00
parent e26f294124
commit 30ed7c42b1
3 changed files with 25 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 609 KiB

+2
View File
@@ -20,6 +20,8 @@
<string>13.0</string>
<key>LSUIElement</key>
<true/>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>NSHumanReadableCopyright</key>
<string>CCS Bar</string>
</dict>
+23
View File
@@ -42,6 +42,29 @@ if [[ -d "$ROOT/Resources/Assets" ]]; then
cp "$ROOT/Resources/Assets/"*.png "$APP/Contents/Resources/" 2>/dev/null || true
fi
# Build AppIcon.icns from AppIcon-source.png (1024x1024 RGBA PNG).
ICON_SRC="$ROOT/Resources/AppIcon-source.png"
if [[ -f "$ICON_SRC" ]]; then
echo "[i] Building AppIcon.icns..."
ICONSET_DIR="$(mktemp -d)/AppIcon.iconset"
mkdir -p "$ICONSET_DIR"
sips -z 16 16 "$ICON_SRC" --out "$ICONSET_DIR/icon_16x16.png" > /dev/null
sips -z 32 32 "$ICON_SRC" --out "$ICONSET_DIR/icon_16x16@2x.png" > /dev/null
sips -z 32 32 "$ICON_SRC" --out "$ICONSET_DIR/icon_32x32.png" > /dev/null
sips -z 64 64 "$ICON_SRC" --out "$ICONSET_DIR/icon_32x32@2x.png" > /dev/null
sips -z 128 128 "$ICON_SRC" --out "$ICONSET_DIR/icon_128x128.png" > /dev/null
sips -z 256 256 "$ICON_SRC" --out "$ICONSET_DIR/icon_128x128@2x.png" > /dev/null
sips -z 256 256 "$ICON_SRC" --out "$ICONSET_DIR/icon_256x256.png" > /dev/null
sips -z 512 512 "$ICON_SRC" --out "$ICONSET_DIR/icon_256x256@2x.png" > /dev/null
sips -z 512 512 "$ICON_SRC" --out "$ICONSET_DIR/icon_512x512.png" > /dev/null
sips -z 1024 1024 "$ICON_SRC" --out "$ICONSET_DIR/icon_512x512@2x.png" > /dev/null
iconutil -c icns "$ICONSET_DIR" -o "$APP/Contents/Resources/AppIcon.icns"
rm -rf "$(dirname "$ICONSET_DIR")"
echo "[OK] AppIcon.icns built."
else
echo "[!] AppIcon-source.png not found at $ICON_SRC — skipping icon." >&2
fi
echo "[i] Signing ($SIGNING)..."
case "$SIGNING" in
adhoc)