Skip to content

Commit

Permalink
build: create pretty install DMG
Browse files Browse the repository at this point in the history
Resolves #3257
  • Loading branch information
osy committed Jan 12, 2022
1 parent 54087cf commit c336c60
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ jobs:
HELPER_PROFILE_UUID: ${{ secrets.HELPER_PROFILE_UUID }}
LAUNCHER_PROFILE_DATA: ${{ secrets.LAUNCHER_PROFILE_DATA }}
LAUNCHER_PROFILE_UUID: ${{ secrets.LAUNCHER_PROFILE_UUID }}
- name: Install appdmg
run: npm install -g appdmg
- name: Download Artifact
uses: actions/download-artifact@v2
with:
Expand Down
8 changes: 7 additions & 1 deletion scripts/package_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ if [ "$MODE" == "app-store" ]; then
cp "$SIGNED/UTM.pkg" "$OUTPUT/UTM.pkg"
else
rm -f "$OUTPUT/UTM.dmg"
hdiutil create -fs HFS+ -srcfolder "$SIGNED/UTM.app" -volname "UTM" "$OUTPUT/UTM.dmg"
command -v appdmg >/dev/null 2>&1
if [ $? -eq 0 ]; then
appdmg "$BASEDIR/resources/appdmg.json" "$OUTPUT/UTM.dmg"
else
echo "appdmg not found, falling back to non-customized DMG creation"
hdiutil create -fs HFS+ -srcfolder "$SIGNED/UTM.app" -volname "UTM" "$OUTPUT/UTM.dmg"
fi
fi
rm -rf "$SIGNED"
Binary file added scripts/resources/UTM-drive.icns
Binary file not shown.
13 changes: 13 additions & 0 deletions scripts/resources/appdmg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"title": "UTM",
"icon": "UTM-drive.icns",
"background": "dmg-background.png",
"format": "UDZO",
"window": {
"size": { "width": 660, "height": 400 }
},
"contents": [
{ "x": 480, "y": 170, "type": "link", "path": "/Applications" },
{ "x": 180, "y": 170, "type": "file", "path": "/tmp/signed/UTM.app" }
]
}
Binary file added scripts/resources/dmg-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scripts/resources/dmg-background@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c336c60

Please sign in to comment.