feat: update build script

This commit is contained in:
2026-05-02 22:40:16 +01:00
parent 2c98ce1c3c
commit 2e9f5a3241
+31 -2
View File
@@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
REPO="$(cd "$(dirname "$0")" && pwd)/build" REPO="$(cd "$(dirname "$0")" && pwd)/build"
APP="$HOME/Applications/Photon Uploader.app" APP="./out/Photon Uploader.app"
CONTENTS="$APP/Contents" CONTENTS="$APP/Contents"
echo "==> Building PhotonUploader (menu bar binary)..." echo "==> Building PhotonUploader (menu bar binary)..."
@@ -41,4 +41,33 @@ echo "==> Signing..."
codesign --force --sign - "$CONTENTS/Helpers/PhotonNotify.app" codesign --force --sign - "$CONTENTS/Helpers/PhotonNotify.app"
codesign --force --sign - "$APP" codesign --force --sign - "$APP"
echo "==> Done. App installed at: $APP" echo "==> Done. App bundle at: $APP"
echo "==> Creating DMG..."
DMG_STAGING="./out/dmg-staging"
DMG_OUT="./out/Photon Uploader.dmg"
if ! command -v create-dmg &>/dev/null; then
echo "Error: create-dmg is not installed. Run: brew install create-dmg" >&2
exit 1
fi
rm -rf "$DMG_STAGING"
mkdir -p "$DMG_STAGING"
cp -r "$APP" "$DMG_STAGING/"
rm -f "$DMG_OUT"
create-dmg \
--volname "Photon Uploader" \
--volicon "$REPO/Resources/AppIcon.icns" \
--window-pos 200 120 \
--window-size 540 380 \
--icon-size 96 \
--icon "Photon Uploader.app" 140 190 \
--hide-extension "Photon Uploader.app" \
--app-drop-link 400 190 \
"$DMG_OUT" \
"$DMG_STAGING"
rm -rf "$DMG_STAGING"
echo "==> Done. DMG at: $DMG_OUT"