-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·34 lines (26 loc) · 896 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·34 lines (26 loc) · 896 Bytes
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
#!/bin/zsh
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
APP="$ROOT/build/Codex Power.app"
CONTENTS="$APP/Contents"
MACOS="$CONTENTS/MacOS"
RESOURCES="$CONTENTS/Resources"
SWIFT_TARGET="${CODEX_POWER_SWIFT_TARGET:-arm64-apple-macosx14.0}"
SIGN_IDENTITY="${CODEX_POWER_SIGN_IDENTITY:--}"
rm -rf "$ROOT/build"
mkdir -p "$MACOS" "$RESOURCES"
/usr/bin/swift "$ROOT/Scripts/make_icon.swift" "$ROOT"
/usr/bin/iconutil -c icns "$ROOT/Assets/CodexPower.iconset" -o "$RESOURCES/CodexPower.icns"
swiftc \
-O \
-parse-as-library \
-target "$SWIFT_TARGET" \
"$ROOT/Sources/main.swift" \
-o "$MACOS/CodexPower"
cp "$ROOT/Info.plist" "$CONTENTS/Info.plist"
CODESIGN_ARGS=(--force --deep --sign "$SIGN_IDENTITY")
if [[ "$SIGN_IDENTITY" != "-" ]]; then
CODESIGN_ARGS+=(--options runtime --timestamp)
fi
/usr/bin/codesign "${CODESIGN_ARGS[@]}" "$APP" >/dev/null
printf "%s\n" "$APP"