-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·42 lines (35 loc) · 1.67 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·42 lines (35 loc) · 1.67 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
#!/bin/bash
# Build BoloPrompt and package it as a proper .app bundle, then code-sign it with
# a stable self-signed identity so macOS keeps Microphone + Accessibility grants.
set -euo pipefail
# Scoped to this build only — lets SwiftPM read its cached bare repos without
# changing your global git config. Harmless and process-local.
export GIT_CONFIG_COUNT=1
export GIT_CONFIG_KEY_0=safe.bareRepository
export GIT_CONFIG_VALUE_0=all
BIN="Bolo" # executable / SwiftPM product name
APP_NAME="BoloPrompt" # user-facing app bundle name
ROOT="$(cd "$(dirname "$0")" && pwd)"
BUILD_DIR="$ROOT/.build/release"
APP_BUNDLE="$ROOT/$APP_NAME.app"
echo "▶ Building (release)…"
swift build -c release
echo "▶ Assembling $APP_NAME.app…"
rm -rf "$APP_BUNDLE"
mkdir -p "$APP_BUNDLE/Contents/MacOS"
mkdir -p "$APP_BUNDLE/Contents/Resources"
cp "$BUILD_DIR/$BIN" "$APP_BUNDLE/Contents/MacOS/$BIN"
cp "$ROOT/Info.plist" "$APP_BUNDLE/Contents/Info.plist"
# WhisperKit / CoreML pull in dynamic frameworks; copy any bundles next to the binary.
if compgen -G "$BUILD_DIR/*.bundle" > /dev/null; then
cp -R "$BUILD_DIR"/*.bundle "$APP_BUNDLE/Contents/Resources/"
fi
# Sign with a STABLE self-signed identity so macOS keeps the app's identity
# across rebuilds — Accessibility/Mic permissions then survive every rebuild.
# (Create the identity once with ./create-signing-cert.sh)
SIGN_ID="Bolo Code Signing"
echo "▶ Code-signing as '$SIGN_ID'…"
codesign --force --deep --sign "$SIGN_ID" "$APP_BUNDLE"
echo "✅ Built $APP_BUNDLE"
echo " Run with: open \"$APP_BUNDLE\" (grant Mic + Accessibility on first launch)"
echo " (executable codename: $BIN — the app is branded $APP_NAME)"