Ship a drag-to-Applications installer instead of a zip

The Desktop artefact is now Work-<version>.dmg rather than a zip: an
installer is what someone expects to be handed, rather than a bare bundle
to file away themselves. Same single build behind both destinations.
This commit is contained in:
2026-09-02 06:36:28 +02:00
parent c96154ca33
commit c989fef6fe
2 changed files with 17 additions and 12 deletions
+14 -9
View File
@@ -3,7 +3,7 @@
# Build once, then put the result in both places, every time:
#
# /Applications/Work.app the copy being tested here
# ~/Desktop/Work-<version>.zip the copy to send someone else
# ~/Desktop/Work-<version>.dmg the installer to send someone else
#
# One build, two destinations — so the thing a tester runs is byte for byte the
# thing that was just tested here, rather than a second build that drifted.
@@ -14,10 +14,10 @@ APP="Work.app"
BUILT="src-tauri/target/release/bundle/macos/$APP"
DEST="/Applications/$APP"
VERSION="$(node -p "require('./package.json').version")"
ZIP="$HOME/Desktop/Work-$VERSION.zip"
DMG="$HOME/Desktop/Work-$VERSION.dmg"
echo "==> building $VERSION"
npm run tauri build -- --bundles app
npm run tauri build -- --bundles app,dmg
echo "==> quitting the running copy"
osascript -e 'quit app "Work"' >/dev/null 2>&1 || true
@@ -32,12 +32,17 @@ echo "==> installing to $DEST"
rm -rf "$DEST"
cp -R "$BUILT" "$DEST"
# ditto rather than zip: it keeps the bundle's symlinks and resource forks,
# which a plain zip mangles into an app that will not open on the other end.
echo "==> packaging to $ZIP"
rm -f "$ZIP"
ditto -c -k --sequesterRsrc --keepParent "$BUILT" "$ZIP"
# The disk image the bundler just made — drag-to-Applications, which is what
# someone expects to be handed rather than a bare bundle to file themselves.
echo "==> copying the installer to $DMG"
BUILT_DMG="$(find src-tauri/target/release/bundle/dmg -name '*.dmg' -maxdepth 1 | head -1)"
if [ -z "$BUILT_DMG" ]; then
echo "no .dmg was produced — check the bundler output above" >&2
exit 1
fi
rm -f "$DMG"
cp "$BUILT_DMG" "$DMG"
echo "==> launching"
open "$DEST"
echo "==> done — $DEST and $ZIP"
echo "==> done — $DEST and $DMG"