-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkshop.sh
More file actions
executable file
·72 lines (63 loc) · 2.65 KB
/
Copy pathworkshop.sh
File metadata and controls
executable file
·72 lines (63 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
# User-facing local build and launch commands for Synth Workshop.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
APP="Synth Workshop Local.app"
BUNDLE_ROOT="${CARGO_TARGET_DIR:-$ROOT/apps/synth_desktop/src-tauri/target}/release/bundle"
APP_PATH="$BUNDLE_ROOT/macos/$APP"
usage() {
cat <<'EOF'
Usage: ./scripts/workshop.sh <build | run | build-and-run>
build Create a local Apple Silicon .app and .dmg without release credentials
run Open the existing local build
build-and-run Build, then open it
Local builds are ad-hoc signed and not notarized. Official downloads remain at
https://www.usesynth.ai/download.
EOF
}
fail() {
printf '[workshop] ERROR: %s\n' "$*" >&2
exit 1
}
build() {
source "$ROOT/scripts/local-toolchain-env.sh"
"$ROOT/scripts/install.sh" --check
VERSION="$(node -p 'require(process.argv[1]).version' "$ROOT/apps/synth_desktop/package.json")"
DMG_PATH="$BUNDLE_ROOT/dmg/Synth Workshop Local_${VERSION}_aarch64.dmg"
command -v uv >/dev/null || fail "Install uv before building Workshop."
[[ -d "$ROOT/node_modules" ]] || fail "Dependencies are not installed. Run: ./scripts/install.sh"
printf '[workshop] building local app and DMG (no release credentials)\n'
source "$ROOT/scripts/prepare-build-sources.sh"
SYNTH_APP_SIGN_IDENTITY=- SYNTH_SIGN_IDENTITY=- APPLE_SIGNING_IDENTITY=- \
"$ROOT/scripts/build-tier.sh" local
[[ -d "$APP_PATH" ]] || fail "Build completed without producing $APP_PATH"
printf '[workshop] applying ad-hoc local signature\n'
bash "$ROOT/scripts/seal-adhoc-trace-import.sh" "$APP_PATH"
/usr/bin/codesign --force --sign - "$APP_PATH"
/usr/bin/codesign --verify --deep --strict "$APP_PATH"
local dmg_root
dmg_root="$(mktemp -d "${TMPDIR:-/tmp}/workshop-local-dmg.XXXXXX")"
trap 'rm -rf "$dmg_root"' RETURN
/usr/bin/ditto "$APP_PATH" "$dmg_root/$APP"
ln -s /Applications "$dmg_root/Applications"
mkdir -p "$(dirname "$DMG_PATH")"
hdiutil create -volname "Synth Workshop Local $VERSION" \
-srcfolder "$dmg_root" -ov -format UDZO "$DMG_PATH" >/dev/null
rm -rf "$dmg_root"
trap - RETURN
printf '[workshop] app: %s\n' "$APP_PATH"
printf '[workshop] dmg: %s\n' "$DMG_PATH"
printf '[workshop] local build is ad-hoc signed and not notarized; do not redistribute it as an official release\n'
}
run() {
[[ -d "$APP_PATH" ]] || fail "No local build found. Run: ./scripts/workshop.sh build"
printf '[workshop] opening %s\n' "$APP_PATH"
/usr/bin/open -na "$APP_PATH"
}
case "${1:-}" in
build) build ;;
run) run ;;
build-and-run) build; run ;;
--help|-h|help) usage ;;
*) usage >&2; fail "Choose build, run, or build-and-run." ;;
esac