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
+3 -3
View File
@@ -101,11 +101,11 @@ npm run ship
One build, two destinations, every time: One build, two destinations, every time:
- `/Applications/Work.app` — the copy tested here - `/Applications/Work.app` — the copy tested here
- `~/Desktop/Work-<version>.zip` — the copy to send someone else - `~/Desktop/Work-<version>.dmg` — the installer to send someone else
Both come from the same build, so a tester runs byte for byte what was just verified 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 rather than a second build that drifted. The disk image is the ordinary drag-to-Applications
zip mangles the bundle's symlinks and the app will not open on the other machine. 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 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 **right-click → Open** rather than a double-click. Gatekeeper refuses it silently
+14 -9
View File
@@ -3,7 +3,7 @@
# Build once, then put the result in both places, every time: # Build once, then put the result in both places, every time:
# #
# /Applications/Work.app the copy being tested here # /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 # 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. # 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" BUILT="src-tauri/target/release/bundle/macos/$APP"
DEST="/Applications/$APP" DEST="/Applications/$APP"
VERSION="$(node -p "require('./package.json').version")" VERSION="$(node -p "require('./package.json').version")"
ZIP="$HOME/Desktop/Work-$VERSION.zip" DMG="$HOME/Desktop/Work-$VERSION.dmg"
echo "==> building $VERSION" echo "==> building $VERSION"
npm run tauri build -- --bundles app npm run tauri build -- --bundles app,dmg
echo "==> quitting the running copy" echo "==> quitting the running copy"
osascript -e 'quit app "Work"' >/dev/null 2>&1 || true osascript -e 'quit app "Work"' >/dev/null 2>&1 || true
@@ -32,12 +32,17 @@ echo "==> installing to $DEST"
rm -rf "$DEST" rm -rf "$DEST"
cp -R "$BUILT" "$DEST" cp -R "$BUILT" "$DEST"
# ditto rather than zip: it keeps the bundle's symlinks and resource forks, # The disk image the bundler just made — drag-to-Applications, which is what
# which a plain zip mangles into an app that will not open on the other end. # someone expects to be handed rather than a bare bundle to file themselves.
echo "==> packaging to $ZIP" echo "==> copying the installer to $DMG"
rm -f "$ZIP" BUILT_DMG="$(find src-tauri/target/release/bundle/dmg -name '*.dmg' -maxdepth 1 | head -1)"
ditto -c -k --sequesterRsrc --keepParent "$BUILT" "$ZIP" 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" echo "==> launching"
open "$DEST" open "$DEST"
echo "==> done — $DEST and $ZIP" echo "==> done — $DEST and $DMG"