feat: add release build script (app + DMG)
build_release.sh: Clean → Build Release → Create DMG. Outputs build/Bugger.app and build/Bugger-1.0.dmg. Uses ad-hoc signing (no developer cert needed). Supports both arm64 and x86_64 architectures. Usage: ./scripts/build_release.sh Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
94a3d76af9
commit
b207918fc6
|
|
@ -0,0 +1,57 @@
|
|||
#!/bin/bash
|
||||
# Build Bugger.app for distribution (personal use, ad-hoc signed).
|
||||
# Prerequisites: Config.xcconfig with your FEISHU_APP_ID / FEISHU_APP_SECRET.
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
PROJECT="Bugger.xcodeproj"
|
||||
SCHEME="Bugger"
|
||||
VERSION="1.0"
|
||||
BUILD_DIR="build"
|
||||
APP_NAME="Bugger.app"
|
||||
|
||||
echo "=== Cleaning ==="
|
||||
xcodebuild -project "$PROJECT" -scheme "$SCHEME" clean 1>/dev/null
|
||||
|
||||
echo "=== Building Release ==="
|
||||
xcodebuild -project "$PROJECT" -scheme "$SCHEME" \
|
||||
-configuration Release \
|
||||
-derivedDataPath "$BUILD_DIR/derived" \
|
||||
build 2>&1 | grep -E "^.../|error:|BUILD|warning:.*Swift"
|
||||
|
||||
# Find the built .app
|
||||
APP_PATH=$(find "$BUILD_DIR/derived/Build/Products/Release" -name "*.app" -type d | head -1)
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
echo "ERROR: Could not find built .app"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== Built: $APP_PATH ==="
|
||||
echo ""
|
||||
|
||||
# Copy to build root
|
||||
rm -rf "$BUILD_DIR/$APP_NAME"
|
||||
cp -R "$APP_PATH" "$BUILD_DIR/$APP_NAME"
|
||||
|
||||
# Create DMG
|
||||
echo "=== Creating DMG ==="
|
||||
mkdir -p "$BUILD_DIR/dmg"
|
||||
rm -rf "$BUILD_DIR/dmg/"*
|
||||
cp -R "$BUILD_DIR/$APP_NAME" "$BUILD_DIR/dmg/"
|
||||
ln -sf /Applications "$BUILD_DIR/dmg/Applications" 2>/dev/null || true
|
||||
|
||||
DMG="$BUILD_DIR/Bugger-${VERSION}.dmg"
|
||||
rm -f "$DMG"
|
||||
hdiutil create -volname Bugger -srcfolder "$BUILD_DIR/dmg" \
|
||||
-ov -format UDZO "$DMG" 1>/dev/null
|
||||
|
||||
echo ""
|
||||
echo "=== Done ==="
|
||||
echo " App: $PWD/$BUILD_DIR/$APP_NAME"
|
||||
echo " DMG: $PWD/$DMG"
|
||||
echo ""
|
||||
echo "To install:"
|
||||
echo " cp -R $BUILD_DIR/$APP_NAME /Applications/"
|
||||
echo ""
|
||||
echo "On first launch, right-click the app → Open (Gatekeeper bypass)."
|
||||
Loading…
Reference in New Issue