SPB Git

spb/zyquo-router Public MIT

One local endpoint, every AI provider — a private OpenAI-compatible LLM gateway for your Mac (170 models, 12 providers).

Swift 95.7% Python 2.3% Shell 1.2% Makefile 0.9%
2.0 KB · 65 lines shellscript
Raw Blame History
1#!/bin/bash2#3#  notarize.sh4#  Zyquo Router5#6#  Author: Simon-Pierre Boucher7#  Mail: contact@spboucher.ai8#9#  Developer ID signing + notarization + stapling, reusing the identity and10#  notarytool keychain profile from the zyquo-term pipeline. Called by11#  `make release` as: notarize.sh <app-dir> <identity> <profile> <entitlements>12#13#  Flow: codesign (hardened runtime, nested binary first) → ditto zip →14#  notarytool submit --wait → staple app → spctl/stapler verify → signed,15#  notarized, stapled DMG.16#17set -euo pipefail1819APP_DIR="$1"; IDENTITY="$2"; PROFILE="$3"; ENTITLEMENTS="$4"2021APP_NAME="$(basename "$APP_DIR" .app)"22DIST="$(dirname "$APP_DIR")"23ZIP="$DIST/$APP_NAME.zip"24DMG="$DIST/ZyquoRouter.dmg"25EXEC="$APP_DIR/Contents/MacOS/ZyquoRouter"2627echo "=== Signing (Developer ID, hardened runtime) ==="28# Nested code first, then the bundle.29codesign --force --options runtime --timestamp \30    --entitlements "$ENTITLEMENTS" \31    --sign "$IDENTITY" "$EXEC"32codesign --force --options runtime --timestamp \33    --entitlements "$ENTITLEMENTS" \34    --sign "$IDENTITY" "$APP_DIR"35codesign --verify --deep --strict --verbose=2 "$APP_DIR"36echo "Signature valid."3738echo "=== Notarizing the app (profile: $PROFILE) ==="39rm -f "$ZIP"40ditto -c -k --keepParent "$APP_DIR" "$ZIP"41xcrun notarytool submit "$ZIP" --keychain-profile "$PROFILE" --wait42xcrun stapler staple "$APP_DIR"43rm -f "$ZIP"4445echo "=== Verifying ==="46spctl -a -vv "$APP_DIR"47xcrun stapler validate "$APP_DIR"4849echo "=== Building signed + notarized DMG ==="50rm -f "$DMG"51DMG_TEMP="$DIST/dmg_temp"52rm -rf "$DMG_TEMP"53mkdir -p "$DMG_TEMP"54cp -R "$APP_DIR" "$DMG_TEMP/"55ln -s /Applications "$DMG_TEMP/Applications"56hdiutil create -volname "$APP_NAME" -srcfolder "$DMG_TEMP" -ov -format UDZO "$DMG"57rm -rf "$DMG_TEMP"58codesign --force --sign "$IDENTITY" --timestamp "$DMG"59xcrun notarytool submit "$DMG" --keychain-profile "$PROFILE" --wait60xcrun stapler staple "$DMG"6162echo "=== Done ==="63echo "App: $APP_DIR (notarized + stapled)"64echo "DMG: $DMG (signed + notarized + stapled)"65