Skip to content

Commit b994b5b

Browse files
author
Максим Лясковский
committed
feat(build): ship .dmg disk images instead of .zip
1 parent 6d30383 commit b994b5b

4 files changed

Lines changed: 74 additions & 12 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,8 @@ jobs:
102102
- name: Build LinkBridge.app
103103
run: ./scripts/build_app.sh
104104

105-
- name: Package .app as a zip with ditto
106-
run: |
107-
cd dist
108-
ditto -c -k --keepParent LinkBridge.app "LinkBridge-v${{ inputs.version }}.zip"
109-
ls -la
105+
- name: Package .app as a .dmg with hdiutil
106+
run: ./scripts/build_dmg.sh "${{ inputs.version }}"
110107

111108
- name: Create draft GitHub Release
112109
env:
@@ -117,4 +114,4 @@ jobs:
117114
--title "LinkBridge v${{ inputs.version }}" \
118115
--notes-file release-notes.md \
119116
--draft \
120-
"dist/LinkBridge-v${{ inputs.version }}.zip"
117+
"dist/LinkBridge-v${{ inputs.version }}.dmg"

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ with a pure-Python macOS menu bar app. The Linux sources are archived under
2929
- 24 ppqn clock generator with drift-compensated absolute-time scheduling
3030
- Reactive Ableton Link integration via `aalink` callbacks (no polling)
3131
- Settings persistence at `~/Library/Application Support/LinkBridge/settings.json`
32-
- Distributed as a double-clickable `LinkBridge.app` bundle (custom icon, `LSUIElement`)
32+
- Distributed as a `.dmg` disk image containing the `LinkBridge.app` bundle and a drag-to-install Applications shortcut (custom icon, `LSUIElement`)
3333
- 22 unit tests covering Settings, MidiOutput, and ClockEngine
3434
- py2app build via `./scripts/build_app.sh`
3535
- GitHub Actions CI: tests on every PR, releases via `workflow_dispatch`

README.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,37 @@ pip install -r requirements-dev.txt
3939
./scripts/build_app.sh
4040
```
4141

42-
The bundle is produced at `dist/LinkBridge.app`. Drag it to `/Applications`
43-
or run it in place.
42+
The bundle is produced at `dist/LinkBridge.app`. To package it as a
43+
distributable disk image:
44+
45+
```bash
46+
./scripts/build_dmg.sh 2.0.0
47+
```
48+
49+
This produces `dist/LinkBridge-v2.0.0.dmg` containing `LinkBridge.app`
50+
plus a symlink to `/Applications` for drag-to-install. Releases on
51+
GitHub Releases ship the `.dmg` exclusively.
52+
53+
**Installation flow:**
54+
55+
- Download `LinkBridge-v<version>.dmg` from the
56+
[latest release](https://github.com/AnyByte/LinkBridge/releases/latest)
57+
- Double-click the `.dmg` to mount it
58+
- Drag `LinkBridge.app` onto the `Applications` shortcut in the disk
59+
image window
60+
- Eject the disk image
61+
- Launch from `/Applications`
4462

4563
**On first launch:**
4664

65+
- The bundle is **unsigned** (no Apple Developer ID). macOS Gatekeeper
66+
may block it the first time — right-click the `.app` in Finder, choose
67+
**Open**, confirm the warning, then launch normally afterwards.
4768
- macOS asks for **local network permission** ("Allow LinkBridge to find
4869
devices on local networks?"). Click **Allow**, otherwise Ableton Link
4970
cannot discover any peers and the tempo stays at the default 120 BPM
5071
forever. The bundle includes a description string explaining what the
5172
permission is used for.
52-
- The bundle is **unsigned** (no Apple Developer ID). If macOS Gatekeeper
53-
blocks it, right-click the `.app` in Finder, choose **Open**, confirm
54-
the warning, then launch normally afterwards.
5573

5674
## Menu reference
5775

scripts/build_dmg.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
# Package dist/LinkBridge.app into dist/LinkBridge-v<version>.dmg using hdiutil.
3+
#
4+
# Usage:
5+
# ./scripts/build_dmg.sh <version>
6+
#
7+
# Requires that ./scripts/build_app.sh has already produced dist/LinkBridge.app.
8+
# The resulting .dmg, when mounted, shows a Finder window with LinkBridge.app
9+
# next to a symlink to /Applications so the user can drag-to-install.
10+
11+
set -euo pipefail
12+
13+
cd "$(dirname "$0")/.."
14+
15+
VERSION="${1:-}"
16+
if [[ -z "$VERSION" ]]; then
17+
echo "usage: $0 <version>" >&2
18+
exit 2
19+
fi
20+
21+
APP="dist/LinkBridge.app"
22+
DMG="dist/LinkBridge-v${VERSION}.dmg"
23+
24+
if [[ ! -d "$APP" ]]; then
25+
echo "error: $APP not found. Run ./scripts/build_app.sh first." >&2
26+
exit 1
27+
fi
28+
29+
rm -f "$DMG"
30+
31+
# Build the contents of the disk image in a temp directory: the .app plus a
32+
# symlink to /Applications so the user can drag-to-install visually.
33+
STAGE=$(mktemp -d -t linkbridge-dmg)
34+
trap 'rm -rf "$STAGE"' EXIT
35+
36+
ditto "$APP" "$STAGE/LinkBridge.app"
37+
ln -s /Applications "$STAGE/Applications"
38+
39+
hdiutil create \
40+
-volname "LinkBridge" \
41+
-srcfolder "$STAGE" \
42+
-ov \
43+
-format UDZO \
44+
"$DMG" >/dev/null
45+
46+
echo "Built: $DMG"
47+
ls -lh "$DMG"

0 commit comments

Comments
 (0)