Use hdiutil for DMG creation instead of create-dmg

create-dmg (brew) uses AppleScript/Finder for icon positioning which
times out on headless CI. Switch to hdiutil with Applications symlink
for reliable CI builds.
This commit is contained in:
Lawrence Chen 2026-02-08 17:20:49 -08:00
parent b4c90a0912
commit 08a654882d

View file

@ -45,7 +45,6 @@ jobs:
brew update
brew install zig
npm uninstall --global create-dmg 2>/dev/null || true
brew install create-dmg
- name: Build GhosttyKit.xcframework
run: |
@ -161,23 +160,14 @@ jobs:
xcrun stapler validate "$APP_PATH"
spctl -a -vv --type execute "$APP_PATH"
rm -f "$ZIP_SUBMIT"
# create-dmg (brew) generates a styled drag-to-install DMG
# It expects: create-dmg [options] <output.dmg> <source_folder>
# --no-internet-enable avoids deprecated flag warning
DMG_SOURCE="$(mktemp -d)"
# Build DMG with Applications symlink (no Finder/AppleScript needed)
DMG_SOURCE="$(mktemp -d)/cmuxterm"
mkdir -p "$DMG_SOURCE"
cp -R "$APP_PATH" "$DMG_SOURCE/"
create-dmg \
--volname "cmuxterm" \
--window-pos 200 120 \
--window-size 660 400 \
--icon-size 160 \
--icon "cmuxterm.app" 180 170 \
--app-drop-link 480 170 \
--no-internet-enable \
--codesign "$APPLE_SIGNING_IDENTITY" \
"$DMG_RELEASE" \
"$DMG_SOURCE"
rm -rf "$DMG_SOURCE"
ln -s /Applications "$DMG_SOURCE/Applications"
hdiutil create -volname "cmuxterm" -srcfolder "$DMG_SOURCE" -ov -format UDZO "$DMG_RELEASE"
rm -rf "$(dirname "$DMG_SOURCE")"
/usr/bin/codesign --force --sign "$APPLE_SIGNING_IDENTITY" "$DMG_RELEASE"
DMG_SUBMIT_JSON="$(xcrun notarytool submit "$DMG_RELEASE" --apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" --wait --output-format json)"
DMG_SUBMIT_ID="$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])' <<<"$DMG_SUBMIT_JSON")"
DMG_STATUS="$(python3 -c 'import json,sys; print(json.load(sys.stdin)["status"])' <<<"$DMG_SUBMIT_JSON")"