Repository navigation
Expand file tree
/
Copy pathmake-app.sh
More file actions
executable file
·48 lines (41 loc) · 2.05 KB
/
Copy pathmake-app.sh
File metadata and controls
executable file
·48 lines (41 loc) · 2.05 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
#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")"
APP="NotchNotes.app"
# VERSION=v1.2.3 (or 1.2.3) stamps the bundle; the release workflow sets it
SHORT="${VERSION:-1.0.0}"
SHORT="${SHORT#v}"
BUILD=$(echo "$SHORT" | awk -F. '{ print $1 * 10000 + $2 * 100 + $3 }') # 1.2.3 -> 10203, always increasing
# 1. Build an optimized binary
swift build -c release
# 2. Create the app bundle structure
rm -rf "$APP"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
cp .build/release/NotchNotes "$APP/Contents/MacOS/NotchNotes"
cp LICENSE "$APP/Contents/Resources/LICENSE" # the MIT notice travels with every copy of the app
cp Resources/AppIcon.icns "$APP/Contents/Resources/AppIcon.icns"
# 3. Info.plist: LSUIElement keeps it out of the Dock and Cmd+Tab
cat > "$APP/Contents/Info.plist" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key> <string>NotchNotes</string>
<key>CFBundleIdentifier</key> <string>com.local.notchnotes</string>
<key>CFBundleExecutable</key> <string>NotchNotes</string>
<key>CFBundleIconFile</key> <string>AppIcon</string>
<key>CFBundlePackageType</key> <string>APPL</string>
<key>CFBundleShortVersionString</key> <string>${SHORT}</string>
<key>CFBundleVersion</key> <string>${BUILD}</string>
<key>NSHumanReadableCopyright</key> <string>Copyright © 2026 Nandan Devadula. MIT License.</string>
<key>LSMinimumSystemVersion</key> <string>13.0</string>
<key>LSUIElement</key> <true/>
<key>NSHighResolutionCapable</key> <true/>
<key>NSCameraUsageDescription</key> <string>Web pages you open can ask to use the camera.</string>
<key>NSMicrophoneUsageDescription</key> <string>Web pages you open can ask to use the microphone.</string>
</dict>
</plist>
EOF
# 4. Ad-hoc sign so macOS runs it without complaint
codesign --force --sign - "$APP"
echo "✅ Built $APP ($SHORT)"