main
anastasia README: install via Adom Bridge, not a manual download (not yet notarized); optional Developer ID signing in build-rele… 312a05e 10d ago
#!/usr/bin/env bash
# Build the macOS release on the desktop: zip (premiere-bridge binary + bridge.json at the
# ROOT) and its manifest, in ~/adom-dev/premiere-bridge/dist/. Prints the manifest.
set -euo pipefail
cd "$(dirname "$0")/.."
python3 scripts/sync-verbs.py
VER=$(python3 -c 'import json; print(json.load(open("bridge.json"))["version"])')
TMPDIR="${TMPDIR:-/tmp}" scripts/dev-sync.sh --no-run | grep -E "error|warning|Finished|-->" || true
SLUG=premiere-bridge
ZIP="adom-bridge-premiere-macos-v$VER.zip"
URL="https://wiki.adom.inc/download/adom/$SLUG/$VER/$ZIP"
MURL="https://wiki.adom.inc/api/v1/pages/$SLUG/files/adom-bridge-premiere-manifest-macos.json"
# Optional Developer ID signing + notarization (needs Adom's Apple team cert in the keychain
# and a notarytool keychain profile):
#   SIGN_ID="Developer ID Application: Adom Inc. (B22GYTS2NN)" NOTARY_PROFILE=adom-notary scripts/build-release.sh
SIGN=""
if [[ -n "${SIGN_ID:-}" ]]; then
  SIGN="codesign --force --options runtime --timestamp -s \"$SIGN_ID\" premiere-bridge && codesign -v --strict premiere-bridge && "
  if [[ -n "${NOTARY_PROFILE:-}" ]]; then
    SIGN+="ditto -c -k premiere-bridge ../notarize.zip && xcrun notarytool submit ../notarize.zip --keychain-profile \"$NOTARY_PROFILE\" --wait && rm ../notarize.zip && "
  fi
fi
CMD="cd ~/adom-dev/premiere-bridge && rm -rf dist && mkdir -p dist/stage && cp target/release/premiere-bridge bridge.json launcher.py dist/stage/ && cd dist/stage && $SIGN zip -q -X ../$ZIP premiere-bridge bridge.json launcher.py && cd .. && rm -rf stage && SHA=\$(shasum -a 256 $ZIP | cut -d' ' -f1) && SIZE=\$(stat -f%z $ZIP) && printf '{\n  \"manifest_version\": 1,\n  \"name\": \"premiere\",\n  \"version\": \"$VER\",\n  \"url\": \"$URL\",\n  \"sha256\": \"%s\",\n  \"size\": %s,\n  \"platform\": \"darwin-arm64\",\n  \"verbPrefixes\": [\"premiere_\"],\n  \"healthEndpoint\": \"/health\",\n  \"updateManifestUrl\": \"$MURL\",\n  \"released_at\": \"%s\"\n}\n' \$SHA \$SIZE \$(date -u +%Y-%m-%dT%H:%M:%SZ) > adom-bridge-premiere-manifest-macos.json && unzip -l $ZIP && cat adom-bridge-premiere-manifest-macos.json"
python3 -c 'import json,sys; print(json.dumps({"command":sys.argv[1],"reason":"Build the Premiere bridge release zip and manifest","timeoutSeconds":120}))' "$CMD" \
  | adom-bridge shell_execute "$(cat)" | python3 -c 'import json,sys; d=json.load(sys.stdin); print(d.get("stdout","")); print(d.get("stderr",""))'