SPB Git

Repository Public

package.sh 1.9 KB 28 lines shellscript

1#!/usr/bin/env bash2# ORIX DJ3# File: Scripts/package.sh4# Description: Builds the distribution artifacts from the notarized, stapled "dist/ORIX DJ.app": a signed DMG (background artwork, Applications shortcut) and a ZIP. The DMG must then be notarized: Scripts/notarize.sh dist/ORIX-DJ-<version>.dmg dmg5#6# Author: Simon-Pierre Boucher7# Contact: contact@spboucher.ai8set -euo pipefail9cd "$(dirname "$0")/.."10APP="dist/ORIX DJ.app"11[[ -d "$APP" ]] || { echo "ERROR: $APP not found." >&2; exit 1; }12xcrun stapler validate "$APP" >/dev/null 2>&1 || { echo "ERROR: the app is not notarized and stapled yet (Scripts/notarize.sh)." >&2; exit 1; }13VERSION="$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' "$APP/Contents/Info.plist")"14BUILD="$(/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' "$APP/Contents/Info.plist")"15DMG="dist/ORIX-DJ-$VERSION.dmg"; ZIP="dist/ORIX-DJ-$VERSION.zip"16IDENTITY="$(codesign -dvv "$APP" 2>&1 | sed -n 's/^Authority=\(Developer ID Application: .*\)$/\1/p' | head -1)"17rm -f "$DMG" "$ZIP"18mkdir -p build19swift Scripts/dmg-background.swift build/dmg-background.png >/dev/null20STAGE="$(mktemp -d)"; ditto "$APP" "$STAGE/ORIX DJ.app"21create-dmg --volname "ORIX DJ $VERSION" --background build/dmg-background.png --window-pos 200 140 --window-size 660 420 \22  --icon-size 128 --icon "ORIX DJ.app" 170 205 --app-drop-link 490 205 --hide-extension "ORIX DJ.app" --no-internet-enable \23  "$DMG" "$STAGE" >/dev/null 2>&1 || { echo "WARNING: create-dmg failed; this DMG has NO background artwork (plain image)"; echo plain > build/dmg-fallback.flag; rm -f "$DMG"; ln -s /Applications "$STAGE/Applications"; hdiutil create -volname "ORIX DJ $VERSION" -srcfolder "$STAGE" -ov -format UDZO "$DMG" >/dev/null; }24rm -rf "$STAGE"25codesign --force --timestamp --sign "$IDENTITY" "$DMG"26ditto -c -k --keepParent "$APP" "$ZIP"27echo "built $DMG and $ZIP (version $VERSION build $BUILD). Notarize the DMG next, then run: Scripts/finalize.sh"28
Files main
Menu

Theme