-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-app.sh
More file actions
executable file
·57 lines (46 loc) · 1.57 KB
/
Copy pathbuild-app.sh
File metadata and controls
executable file
·57 lines (46 loc) · 1.57 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
#!/bin/bash
# Build the Swift executable
echo "Building Swift project..."
swift build -c release
# Create app bundle structure
APP_NAME="FAC1 Controller.app"
BUNDLE_DIR="$APP_NAME/Contents"
MACOS_DIR="$BUNDLE_DIR/MacOS"
RESOURCES_DIR="$BUNDLE_DIR/Resources"
echo "Creating app bundle..."
rm -rf "$APP_NAME"
mkdir -p "$MACOS_DIR"
mkdir -p "$RESOURCES_DIR"
# Copy executable
cp .build/release/FAC1-Controller "$MACOS_DIR/"
# Copy Info.plist
cp Info.plist "$BUNDLE_DIR/"
# Copy icon if it exists
if [ -f "AppIcon.icns" ]; then
cp AppIcon.icns "$RESOURCES_DIR/"
fi
echo "App bundle created: $APP_NAME"
# Check if signing identity is provided
if [ ! -z "$1" ]; then
echo "Signing app with identity: $1"
codesign --deep --force --options runtime --sign "$1" "$APP_NAME"
if [ $? -eq 0 ]; then
echo "✓ App signed successfully"
# Create DMG for notarization
echo "Creating DMG..."
hdiutil create -volname "FAC1 Controller" -srcfolder "$APP_NAME" -ov -format UDZO "FAC1-Controller.dmg"
echo ""
echo "To notarize, run:"
echo " xcrun notarytool submit FAC1-Controller.dmg --apple-id YOUR_EMAIL --team-id YOUR_TEAM_ID --password YOUR_APP_SPECIFIC_PASSWORD --wait"
echo ""
echo "After notarization completes, staple it:"
echo " xcrun stapler staple \"$APP_NAME\""
else
echo "✗ Signing failed"
fi
else
echo ""
echo "App created but not signed."
echo "To sign and notarize, run:"
echo " ./build-app.sh \"Developer ID Application: Your Name (TEAM_ID)\""
fi