Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Replace appdmg with native dmg packaging for auth macOS releases

Manav Rathi66f6b8b08fb1
diff --git a/.github/workflows/auth-build.yml b/.github/workflows/auth-build.yml
index ba9444af42..24ba36c335 100644
--- a/.github/workflows/auth-build.yml
+++ b/.github/workflows/auth-build.yml
@@ -559,20 +559,14 @@ jobs:
BUILD_CERTIFICATE_BASE64: ${{ secrets.MAC_OS_CERTIFICATE }}
P12_PASSWORD: ${{ secrets.MAC_OS_CERTIFICATE_PASSWORD }}
- - name: Install build dependencies
- run: |
- pip3 install setuptools --break-system-packages
- npm install -g appdmg
-
- name: Create artifacts directory
run: mkdir artifacts
- name: Build macOS DMG
run: |
flutter config --enable-macos-desktop
- dart pub global activate --source git https://github.com/ente-io/fastforgefork --git-ref develop --git-path packages/fastforge
- fastforge package --platform=macos --targets=dmg --skip-clean
- mv dist/**/*-macos.dmg "artifacts/${ARTIFACT_STEM}.dmg"
+ flutter build macos --release
+ ./macos/packaging/dmg/make-dmg.sh "build/macos/Build/Products/Release/Ente Auth.app" "artifacts/${ARTIFACT_STEM}.dmg"
- name: Code sign DMG
run: |
diff --git a/mobile/apps/auth/distribute_options.yaml b/mobile/apps/auth/distribute_options.yaml
index 9634f4cbda..c955d9e903 100644
--- a/mobile/apps/auth/distribute_options.yaml
+++ b/mobile/apps/auth/distribute_options.yaml
@@ -19,7 +19,3 @@ releases:
package:
platform: windows
target: exe
- - name: release-dev-macos-dmg
- package:
- platform: macos
- target: dmg
diff --git a/mobile/apps/auth/macos/packaging/dmg/DS_Store b/mobile/apps/auth/macos/packaging/dmg/DS_Store
new file mode 100644
index 0000000000..1993012e49
Binary files /dev/null and b/mobile/apps/auth/macos/packaging/dmg/DS_Store differ
diff --git a/mobile/apps/auth/macos/packaging/dmg/make-dmg.sh b/mobile/apps/auth/macos/packaging/dmg/make-dmg.sh
new file mode 100755
index 0000000000..1fe84953ee
--- /dev/null
+++ b/mobile/apps/auth/macos/packaging/dmg/make-dmg.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# Package the built "Ente Auth.app" into a styled DMG using only tools that
+# ship with macOS.
+#
+# make-dmg.sh path/to/Ente\ Auth.app out.dmg
+#
+# The Finder appearance (window size, icon positions) comes from the
+# committed DS_Store; the commit that introduced it has the regeneration
+# recipe.
+
+set -eu
+
+app=$1
+out=$2
+
+dir=$(cd "$(dirname "$0")" && pwd)
+staging=$(mktemp -d)
+trap 'rm -rf "$staging"' EXIT
+
+mkdir "$staging/root"
+cp -R "$app" "$staging/root/Ente Auth.app"
+ln -s /Applications "$staging/root/Applications"
+cp "$dir/DS_Store" "$staging/root/.DS_Store"
+
+icon="$dir/../../../assets/generation-icons/icon-macos.png"
+mkdir "$staging/vol.iconset"
+for size in 16 32 128 256 512; do
+ sips -z "$size" "$size" "$icon" \
+ --out "$staging/vol.iconset/icon_${size}x${size}.png" >/dev/null
+ sips -z "$((size * 2))" "$((size * 2))" "$icon" \
+ --out "$staging/vol.iconset/icon_${size}x${size}@2x.png" >/dev/null
+done
+iconutil --convert icns "$staging/vol.iconset" \
+ --output "$staging/root/.VolumeIcon.icns"
+
+hdiutil create -volname Auth -fs HFS+ -format UDRW \
+ -srcfolder "$staging/root" -ov "$staging/rw.dmg"
+
+# The kHasCustomIcon Finder flag must be set on the mounted volume root; it
+# does not survive the -srcfolder copy.
+hdiutil attach "$staging/rw.dmg" -noautoopen -mountpoint "$staging/mnt"
+xattr -wx com.apple.FinderInfo \
+ "0000000000000000040000000000000000000000000000000000000000000000" \
+ "$staging/mnt"
+hdiutil detach "$staging/mnt"
+
+hdiutil convert "$staging/rw.dmg" -format UDZO -ov -o "$out"
diff --git a/mobile/apps/auth/macos/packaging/dmg/make_config.yaml b/mobile/apps/auth/macos/packaging/dmg/make_config.yaml
deleted file mode 100644
index cd16dd7b7b..0000000000
--- a/mobile/apps/auth/macos/packaging/dmg/make_config.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-title: Auth
-icon: ../../../assets/generation-icons/icon-macos.png
-contents:
- - x: 448
- y: 344
- type: link
- path: "/Applications"
- - x: 192
- y: 344
- type: file
- path: Ente Auth.app