Skip to content

Commit 108b41e

Browse files
committed
Add DMG installer creation for direct distribution
Adds `just dmg <version>` command to create a classic macOS DMG installer with drag-to-Applications window. The DMG wraps the already-notarized app so no separate notarization is needed. Changes: - scripts/create-dmg.sh: Creates DMG with custom background and icon layout - assets/dmg-background.{svg,png}: Background image with arrow and instructions - Justfile: Added `dmg` command - RELEASE.md: Updated release steps to include DMG creation - README.md: Moved Download section to top, added install instructions Requires: brew install create-dmg
1 parent 90c3e49 commit 108b41e

6 files changed

Lines changed: 107 additions & 2 deletions

File tree

Justfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ log id:
9393
builds:
9494
@ls -d {{build_dir}}/v* {{build_dir}}/dev 2>/dev/null | xargs -I{} basename {} | sort -V || echo "(none)"
9595

96+
# Create DMG installer (requires create-dmg: brew install create-dmg)
97+
dmg version="":
98+
./scripts/create-dmg.sh {{version}}
99+
96100
# =============================================================================
97101
# App Store (requires Apple Distribution certificate)
98102
# =============================================================================

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ A Safari extension that displays CDN cache status (HIT/MISS) for the current pag
88
![Manifest V3](https://img.shields.io/badge/Manifest-V3-green)
99
![License MIT](https://img.shields.io/badge/License-MIT-yellow)
1010

11+
## Download
12+
13+
Download the latest release from [GitHub Releases](https://github.com/bartTC/CacheStatusSafariExtension/releases/latest).
14+
15+
After downloading, unzip and move the app to your Applications folder. On first launch, open Safari → Settings → Extensions and enable Cache Status.
16+
1117
## Features
1218

1319
- **Toolbar Badge** — Color-coded cache status (HIT/MISS) visible at a glance
@@ -100,6 +106,7 @@ just xcode # Open project in Xcode
100106
## Release Process
101107

102108
See [RELEASE.md](RELEASE.md) for the full release guide covering:
109+
103110
- Direct distribution (GitHub) with notarization
104111
- Mac App Store submission
105112

RELEASE.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ just wait
6464

6565
# 5. Staple notarization ticket and create final zip
6666
just staple
67+
68+
# 6. Create DMG installer (optional, requires: brew install create-dmg)
69+
just dmg v0.0.6
6770
```
6871

6972
### Output
@@ -73,7 +76,8 @@ build/
7376
└── v0.0.6/
7477
├── CacheStatus.xcarchive # Xcode archive
7578
├── CF Cache Status.app # Signed app
76-
├── CF.Cache.Status.v0.0.6.zip # Final notarized release
79+
├── CF.Cache.Status.v0.0.6.zip # Final notarized release (for GitHub)
80+
├── CacheStatus-v0.0.6.dmg # DMG installer (optional)
7781
└── .submission_id # Notarization tracking
7882
```
7983

@@ -206,6 +210,7 @@ Before releasing a new version:
206210
4. [ ] Push tag: `git push origin v0.0.X`
207211
5. [ ] Build releases:
208212
- [ ] `just release v0.0.X` (direct)
213+
- [ ] `just dmg v0.0.X` (optional DMG installer)
209214
- [ ] `just release-appstore v0.0.X` (App Store)
210-
6. [ ] Create GitHub release with the `.zip` file
215+
6. [ ] Create GitHub release with `.zip` (and optionally `.dmg`)
211216
7. [ ] Submit App Store version in App Store Connect

assets/dmg-background.png

66.5 KB
Loading

assets/dmg-background.svg

Lines changed: 16 additions & 0 deletions
Loading

scripts/create-dmg.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Create DMG installer with drag-to-Applications window
5+
# Usage: ./scripts/create-dmg.sh [version]
6+
7+
BUILD_DIR="${BUILD_DIR:-build}"
8+
9+
if [[ -n "$1" ]]; then
10+
ver="$1"
11+
elif [[ -f "$BUILD_DIR/.current_version" ]]; then
12+
ver=$(cat "$BUILD_DIR/.current_version")
13+
else
14+
echo "Error: No version specified"
15+
exit 1
16+
fi
17+
18+
ver_dir="$BUILD_DIR/$ver"
19+
app_path="$ver_dir/export/CF Cache Status.app"
20+
dmg_path="$ver_dir/CacheStatus-$ver.dmg"
21+
22+
if [[ ! -d "$app_path" ]]; then
23+
echo "Error: App not found at $app_path"
24+
echo "Run 'just archive $ver' first."
25+
exit 1
26+
fi
27+
28+
# Remove existing DMG if present
29+
rm -f "$dmg_path"
30+
31+
echo "Creating DMG for $ver..."
32+
33+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
34+
BACKGROUND="$SCRIPT_DIR/../assets/dmg-background.png"
35+
36+
# Window layout (600x400):
37+
#
38+
# ┌──────────────────────────────────────────────┐
39+
# │ │
40+
# │ [App Icon] ───► [Applications] │
41+
# │ x=150 x=450 │
42+
# │ y=85 y=85 │
43+
# │ │
44+
# │ "Drag to Applications to install" │
45+
# │ │
46+
# └──────────────────────────────────────────────┘
47+
48+
create-dmg \
49+
--volname "Cache Status" \
50+
--volicon "$app_path/Contents/Resources/AppIcon.icns" \
51+
--background "$BACKGROUND" \
52+
--window-pos 200 120 \
53+
--window-size 600 400 \
54+
--icon-size 100 \
55+
--icon "CF Cache Status.app" 150 125 \
56+
--app-drop-link 450 125 \
57+
--hide-extension "CF Cache Status.app" \
58+
"$dmg_path" \
59+
"$app_path"
60+
61+
# Options explained:
62+
# --volname Name shown in Finder title bar and mounted volume
63+
# --volicon Icon for the mounted DMG volume
64+
# --background Background image (600x400 PNG with arrow/instructions)
65+
# --window-pos Where the Finder window opens on screen (x y from top-left)
66+
# --window-size Finder window dimensions (width height)
67+
# --icon-size Size of icons in the window (pixels)
68+
# --icon Position of the app: "Name.app" x y (from top-left of window)
69+
# --app-drop-link Position of Applications folder shortcut: x y
70+
# --hide-extension Hide .app extension for cleaner look
71+
72+
echo ""
73+
echo "DMG created: $dmg_path"

0 commit comments

Comments
 (0)