Files
ICCery-CPU/Scripts/package_release.sh
T
Local Admin 43bff18101
Build macOS Packages / Build macOS (Intel) (push) Failing after 10s
Build macOS Packages / Build macOS (Apple Silicon) (push) Failing after 10s
Build macOS Packages / Build macOS (Universal) (push) Skipped
removed cruft and restructured.
2026-09-07 05:21:44 -07:00

56 lines
1.5 KiB
Bash

#!/bin/bash
# Stage one architecture's .app into:
# - vendored zip for ICCery (macos-x86_64 | macos-aarch64 | macos-universal)
# - installable .dmg
# Usage: package_release.sh <arch> <prefix>
# arch = x86_64 | arm64 | universal
# prefix = TargetPrint_v1.0.0-abc1234-macos-x86_64
set -euo pipefail
ARCH="${1:?arch required}"
PREFIX="${2:?prefix required}"
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
# shellcheck source=lib.sh
source "$(dirname "$0")/lib.sh"
case "$ARCH" in
x86_64) VENDOR_DIR="macos-x86_64" ;;
arm64) VENDOR_DIR="macos-aarch64" ;;
universal) VENDOR_DIR="macos-universal" ;;
*) echo "arch must be x86_64, arm64, or universal" >&2; exit 2 ;;
esac
APP="$ROOT/build/apps/$ARCH/TargetPrint.app"
test -d "$APP"
ASSETS="$ROOT/build/release-assets"
VENDOR="$ASSETS/vendor-iccery/$VENDOR_DIR"
mkdir -p "$ASSETS" "$VENDOR"
echo "==> Vendoring $APP$VENDOR/TargetPrint.app"
rm -rf "$VENDOR/TargetPrint.app"
cp -R "$APP" "$VENDOR/TargetPrint.app"
ZIP="$ASSETS/${PREFIX}.app.zip"
DMG="$ASSETS/${PREFIX}.dmg"
echo "==> Zipping $ZIP"
zip_app "$APP" "$ZIP"
echo "==> DMG $DMG"
"$(dirname "$0")/create_dmg.sh" "$APP" "$DMG" "TargetPrint"
# Record architecture in a sidecar so ICCery's fetch script can assert it.
{
echo "name=TargetPrint"
echo "arch=$ARCH"
echo "vendor_dir=$VENDOR_DIR"
echo "binary=TargetPrint.app/Contents/MacOS/TargetPrint"
lipo -info "$APP/Contents/MacOS/TargetPrint" || true
} > "$VENDOR/ARCH.txt"
echo "==> staged $ZIP"
echo "==> staged $DMG"
echo "==> staged $VENDOR/TargetPrint.app"