diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f175893..b92fa49 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,19 +127,12 @@ jobs: - name: Create DMG run: | TAG=${{ github.event.release.tag_name }} - brew install create-dmg - create-dmg \ - --volname "InputMetrics" \ - --background "assets/dmg-background.png" \ - --window-pos 200 120 \ - --window-size 700 400 \ - --icon-size 100 \ - --text-size 1 \ - --icon "InputMetrics.app" 180 190 \ - --hide-extension "InputMetrics.app" \ - --app-drop-link 520 190 \ - "InputMetrics-${TAG}.dmg" \ - "build/export/InputMetrics.app" + pip3 install dmgbuild + dmgbuild \ + -s scripts/dmg-settings.py \ + -D app=build/export/InputMetrics.app \ + "InputMetrics" \ + "InputMetrics-${TAG}.dmg" - name: Notarize and staple DMG env: diff --git a/scripts/dmg-settings.py b/scripts/dmg-settings.py new file mode 100644 index 0000000..8aaf80b --- /dev/null +++ b/scripts/dmg-settings.py @@ -0,0 +1,29 @@ +# dmgbuild settings for InputMetrics +# https://dmgbuild.readthedocs.io/en/latest/settings.html +import os + +application = defines.get("app", "build/export/InputMetrics.app") +appname = os.path.basename(application) + +files = [application] +symlinks = {"Applications": "/Applications"} + +icon_locations = { + appname: (180, 190), + "Applications": (520, 190), +} + +background = "assets/dmg-background.png" + +show_status_bar = False +show_tab_view = False +show_toolbar = False +show_pathbar = False +show_sidebar = False + +window_rect = ((200, 120), (700, 400)) +default_view = "icon-view" +show_icon_preview = False + +icon_size = 100 +text_size = 1