Skip to content

Commit b0ed349

Browse files
eriknielsenclaude
andcommitted
Fix DMG: Finder alias instead of symlink, inside-out signing in CI
Local build script: - Replace --app-drop-link with Finder alias to /Applications - Symlinks show broken/generic icon on macOS Sonoma+ in read-only DMGs - Finder aliases always resolve the proper Applications folder icon CI release workflow: - Replace ln -s with Finder alias + create-dmg (matching local script) - Replace --deep codesigning with inside-out signing (XPC → Sparkle → app) - Add branded DMG background, icon positioning, and volume icon - Install create-dmg in CI dependencies Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 982a804 commit b0ed349

File tree

2 files changed

+47
-11
lines changed

2 files changed

+47
-11
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@v4
1717

1818
- name: Install dependencies
19-
run: brew install xcodegen xcbeautify
19+
run: brew install xcodegen xcbeautify create-dmg
2020

2121
- name: Generate Xcode project
2222
run: xcodegen generate
@@ -89,12 +89,31 @@ jobs:
8989
DEVELOPER_ID_APPLICATION: ${{ secrets.DEVELOPER_ID_APPLICATION }}
9090
run: |
9191
APP_PATH="build/DerivedData/Build/Products/Release/Lockpaw.app"
92+
SPARKLE_FW="${APP_PATH}/Contents/Frameworks/Sparkle.framework"
93+
SPARKLE_VER="${SPARKLE_FW}/Versions/B"
9294
93-
codesign --force --deep --sign "$DEVELOPER_ID_APPLICATION" \
94-
--options runtime \
95-
"$APP_PATH"
95+
sign_item() {
96+
codesign --force --sign "$DEVELOPER_ID_APPLICATION" --options runtime --timestamp "$1"
97+
}
9698
97-
codesign --verify --verbose "$APP_PATH"
99+
# Sign inside-out: Sparkle internals → XPC → framework → app
100+
for xpc in "${SPARKLE_VER}/XPCServices/Downloader.xpc" "${SPARKLE_VER}/XPCServices/Installer.xpc"; do
101+
[ -d "${xpc}" ] || continue
102+
sign_item "${xpc}/Contents/MacOS/$(basename "${xpc}" .xpc)"
103+
sign_item "${xpc}"
104+
done
105+
106+
[ -f "${SPARKLE_VER}/Autoupdate" ] && sign_item "${SPARKLE_VER}/Autoupdate"
107+
108+
if [ -d "${SPARKLE_VER}/Updater.app" ]; then
109+
sign_item "${SPARKLE_VER}/Updater.app/Contents/MacOS/Updater"
110+
sign_item "${SPARKLE_VER}/Updater.app"
111+
fi
112+
113+
sign_item "${SPARKLE_FW}"
114+
sign_item "${APP_PATH}"
115+
116+
codesign --verify --verbose "${APP_PATH}"
98117
99118
- name: Create DMG
100119
if: steps.check-secrets.outputs.can_sign == 'true'
@@ -105,12 +124,24 @@ jobs:
105124
106125
mkdir -p "$DMG_DIR"
107126
cp -R "$APP_PATH" "$DMG_DIR/"
108-
ln -s /Applications "$DMG_DIR/Applications"
109127
110-
hdiutil create -volname "Lockpaw" \
111-
-srcfolder "$DMG_DIR" \
112-
-ov -format UDZO \
113-
"$DMG_PATH"
128+
# Finder alias instead of symlink — symlinks show broken icon on Sonoma+
129+
osascript -e "tell application \"Finder\" to make new alias file at POSIX file \"$(cd "$DMG_DIR" && pwd)\" to POSIX file \"/Applications\""
130+
131+
create-dmg \
132+
--volname "Lockpaw" \
133+
--volicon "scripts/dmg-volume-icon.icns" \
134+
--background "scripts/dmg-background@2x.png" \
135+
--window-pos 200 120 \
136+
--window-size 660 400 \
137+
--icon-size 96 \
138+
--text-size 14 \
139+
--icon "Lockpaw.app" 170 180 \
140+
--hide-extension "Lockpaw.app" \
141+
--icon "Applications" 490 180 \
142+
--no-internet-enable \
143+
"$DMG_PATH" \
144+
"$DMG_DIR"
114145
115146
- name: Notarize DMG
116147
if: steps.check-secrets.outputs.can_sign == 'true'

scripts/build-release.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ mkdir -p "${DMG_DIR}"
6464
cp -R "${APP_PATH}" "${DMG_DIR}/"
6565
rm -rf "${SIGN_DIR}"
6666

67+
# Create a Finder alias to /Applications instead of a symlink.
68+
# Symlinks show a broken/generic icon on macOS Sonoma+ when mounted as read-only DMG.
69+
# Finder aliases always resolve the proper Applications folder icon.
70+
osascript -e "tell application \"Finder\" to make new alias file at POSIX file \"$(cd "${DMG_DIR}" && pwd)\" to POSIX file \"/Applications\""
71+
6772
create-dmg \
6873
--volname "${APP_NAME}" \
6974
--volicon "scripts/dmg-volume-icon.icns" \
@@ -74,7 +79,7 @@ create-dmg \
7479
--text-size 14 \
7580
--icon "${APP_NAME}.app" 170 180 \
7681
--hide-extension "${APP_NAME}.app" \
77-
--app-drop-link 490 180 \
82+
--icon "Applications" 490 180 \
7883
--no-internet-enable \
7984
"${DMG_PATH}" \
8085
"${DMG_DIR}"

0 commit comments

Comments
 (0)