Skip to content

Commit fac77e0

Browse files
committed
feat: package macOS builds as .app bundle in .dmg installer
Create a proper HostSync.app bundle with Info.plist, then package it into a DMG with an Applications symlink so users can drag-and-drop to install. Replaces the previous bare binary tar.gz for macOS.
1 parent 4cd903e commit fac77e0

3 files changed

Lines changed: 79 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,30 @@ jobs:
8888
if: matrix.cross
8989
run: aarch64-linux-gnu-strip target/${{ matrix.target }}/release/${{ matrix.artifact }}
9090

91+
- name: Create macOS .app bundle
92+
if: runner.os == 'macOS'
93+
run: |
94+
APP="HostSync.app"
95+
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
96+
cp target/${{ matrix.target }}/release/${{ matrix.artifact }} "$APP/Contents/MacOS/hostsync"
97+
cp crates/hostsync-desktop/Info.plist "$APP/Contents/"
98+
99+
- name: Create macOS .dmg
100+
if: runner.os == 'macOS'
101+
run: |
102+
mkdir -p dmg-staging
103+
cp -r HostSync.app dmg-staging/
104+
ln -s /Applications dmg-staging/Applications
105+
hdiutil create -volname "HostSync" -srcfolder dmg-staging -ov -format UDZO "HostSync-${{ matrix.name }}.dmg"
106+
107+
- uses: actions/upload-artifact@v4
108+
if: runner.os == 'macOS'
109+
with:
110+
name: hostsync-${{ matrix.name }}
111+
path: HostSync-${{ matrix.name }}.dmg
112+
91113
- uses: actions/upload-artifact@v4
114+
if: runner.os != 'macOS'
92115
with:
93116
name: hostsync-${{ matrix.name }}
94117
path: target/${{ matrix.target }}/release/${{ matrix.artifact }}
@@ -218,7 +241,7 @@ jobs:
218241
- name: Package artifacts
219242
run: |
220243
cd artifacts
221-
for dir in hostsync-linux-* hostsync-macos-*; do
244+
for dir in hostsync-linux-*; do
222245
[ -d "$dir" ] && chmod +x "$dir/hostsync" && tar czf "${dir}.tar.gz" -C "$dir" hostsync
223246
done
224247
for dir in hostsync-windows-*; do
@@ -236,7 +259,7 @@ jobs:
236259
artifacts/hostsync-linux-arm64.tar.gz
237260
artifacts/hostsync-windows-x64.zip
238261
artifacts/hostsync-windows-arm64.zip
239-
artifacts/hostsync-macos-x64.tar.gz
240-
artifacts/hostsync-macos-arm64.tar.gz
262+
artifacts/hostsync-macos-x64/HostSync-macos-x64.dmg
263+
artifacts/hostsync-macos-arm64/HostSync-macos-arm64.dmg
241264
artifacts/android-apk/HostSync.apk
242265
artifacts/ios-ipa/HostSync.ipa

.github/workflows/release.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,38 @@ jobs:
8989
if: matrix.cross
9090
run: aarch64-linux-gnu-strip target/${{ matrix.target }}/release/${{ matrix.artifact }}
9191

92-
- name: Package (Unix)
93-
if: runner.os != 'Windows'
92+
- name: Create macOS .app bundle
93+
if: runner.os == 'macOS'
94+
run: |
95+
APP="HostSync.app"
96+
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
97+
cp target/${{ matrix.target }}/release/${{ matrix.artifact }} "$APP/Contents/MacOS/hostsync"
98+
cp crates/hostsync-desktop/Info.plist "$APP/Contents/"
99+
100+
- name: Create macOS .dmg
101+
if: runner.os == 'macOS'
102+
run: |
103+
mkdir -p dmg-staging
104+
cp -r HostSync.app dmg-staging/
105+
ln -s /Applications dmg-staging/Applications
106+
hdiutil create -volname "HostSync" -srcfolder dmg-staging -ov -format UDZO "HostSync-${{ matrix.name }}.dmg"
107+
108+
- name: Package (Linux)
109+
if: runner.os == 'Linux'
94110
run: tar czf hostsync-${{ matrix.name }}.tar.gz -C target/${{ matrix.target }}/release ${{ matrix.artifact }}
95111

96112
- name: Package (Windows)
97113
if: runner.os == 'Windows'
98114
run: Compress-Archive -Path target/${{ matrix.target }}/release/${{ matrix.artifact }} -DestinationPath hostsync-${{ matrix.name }}.zip
99115

100116
- uses: actions/upload-artifact@v4
117+
if: runner.os == 'macOS'
118+
with:
119+
name: hostsync-${{ matrix.name }}
120+
path: HostSync-${{ matrix.name }}.dmg
121+
122+
- uses: actions/upload-artifact@v4
123+
if: runner.os != 'macOS'
101124
with:
102125
name: hostsync-${{ matrix.name }}
103126
path: hostsync-${{ matrix.name }}.*
@@ -203,8 +226,8 @@ jobs:
203226
artifacts/hostsync-linux-arm64/hostsync-linux-arm64.tar.gz
204227
artifacts/hostsync-windows-x64/hostsync-windows-x64.zip
205228
artifacts/hostsync-windows-arm64/hostsync-windows-arm64.zip
206-
artifacts/hostsync-macos-x64/hostsync-macos-x64.tar.gz
207-
artifacts/hostsync-macos-arm64/hostsync-macos-arm64.tar.gz
229+
artifacts/hostsync-macos-x64/HostSync-macos-x64.dmg
230+
artifacts/hostsync-macos-arm64/HostSync-macos-arm64.dmg
208231
artifacts/android-apk/HostSync.apk
209232
artifacts/ios-ipa/HostSync.ipa
210233

crates/hostsync-desktop/Info.plist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleName</key>
6+
<string>HostSync</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>HostSync</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>com.hostsync.app</string>
11+
<key>CFBundleVersion</key>
12+
<string>1.0.0</string>
13+
<key>CFBundleShortVersionString</key>
14+
<string>1.0.0</string>
15+
<key>CFBundlePackageType</key>
16+
<string>APPL</string>
17+
<key>CFBundleExecutable</key>
18+
<string>hostsync</string>
19+
<key>LSMinimumSystemVersion</key>
20+
<string>11.0</string>
21+
<key>NSHighResolutionCapable</key>
22+
<true/>
23+
<key>CFBundleIconFile</key>
24+
<string>AppIcon</string>
25+
</dict>
26+
</plist>

0 commit comments

Comments
 (0)