Files
ICCery-CPU/Scripts/lib.sh
T
Local Admin 1c53e698aa
Build macOS Packages / Build macOS (Intel) (push) Failing after 15s
Build macOS Packages / Build macOS (Apple Silicon) (push) Failing after 29s
Build macOS Packages / Build macOS (Universal) (push) Skipped
build fixes
2026-09-07 06:11:55 -07:00

48 lines
1.1 KiB
Bash

#!/bin/bash
# Shared helpers for TargetPrint release scripts.
macos_root() {
# Works when this tree is the Gitea repo root *or* lives under macos/.
local here
here="$(cd "$(dirname "${BASH_SOURCE[1]}")/.." && pwd)"
if [[ -d "$here/TargetPrint.xcodeproj" ]]; then
echo "$here"
return
fi
if [[ -d "$here/macos/TargetPrint.xcodeproj" ]]; then
echo "$here/macos"
return
fi
echo "$here"
}
sign_app() {
local app="$1"
local entitlements="$2"
local identity="${MACOS_CODESIGN_IDENTITY:--}"
if ! command -v codesign >/dev/null 2>&1; then
echo "codesign not available; skipping"
return 0
fi
codesign --force --deep --options runtime \
--sign "$identity" \
--entitlements "$entitlements" \
"$app"
codesign --verify --verbose=2 "$app" || true
}
cpu_jobs() {
if [ -n "${JOBS:-}" ]; then
echo "$JOBS"
return
fi
sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4
}
zip_app() {
local app="$1"
local dest="$2"
rm -f "$dest"
ditto -c -k --keepParent "$app" "$dest"
}