From c989fef6fe12cb29ceb527da3a930bf33d1f386c Mon Sep 17 00:00:00 2001 From: Vincent Date: Wed, 2 Sep 2026 06:36:28 +0200 Subject: [PATCH] Ship a drag-to-Applications installer instead of a zip The Desktop artefact is now Work-.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. --- README.md | 6 +++--- scripts/ship.sh | 23 ++++++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0c797a3..e9b3cce 100644 --- a/README.md +++ b/README.md @@ -101,11 +101,11 @@ npm run ship One build, two destinations, every time: - `/Applications/Work.app` — the copy tested here -- `~/Desktop/Work-.zip` — the copy to send someone else +- `~/Desktop/Work-.dmg` — the installer to send someone else Both come from the same build, so a tester runs byte for byte what was just verified -rather than a second build that drifted. The zip is made with `ditto`, not `zip`: a plain -zip mangles the bundle's symlinks and the app will not open on the other machine. +rather than a second build that drifted. The disk image is the ordinary drag-to-Applications +kind — what someone expects to be handed, rather than a bare bundle to file themselves. The app is ad-hoc signed, so the first launch on someone else's Mac needs **right-click → Open** rather than a double-click. Gatekeeper refuses it silently diff --git a/scripts/ship.sh b/scripts/ship.sh index a1cb8b9..91aac4e 100755 --- a/scripts/ship.sh +++ b/scripts/ship.sh @@ -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-.zip the copy to send someone else +# ~/Desktop/Work-.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"