Replace CI build with local release script
This commit is contained in:
31
scripts/build_release.sh
Executable file
31
scripts/build_release.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
BUILD_DIR="$ROOT_DIR/build"
|
||||
ARTIFACTS_DIR="$ROOT_DIR/dist"
|
||||
SCHEME="iKeyMon"
|
||||
PROJECT="iKeyMon.xcodeproj"
|
||||
|
||||
rm -rf "$BUILD_DIR" "$ARTIFACTS_DIR"
|
||||
mkdir -p "$ARTIFACTS_DIR"
|
||||
|
||||
xcodebuild \
|
||||
-project "$ROOT_DIR/$PROJECT" \
|
||||
-scheme "$SCHEME" \
|
||||
-configuration Release \
|
||||
-derivedDataPath "$BUILD_DIR" \
|
||||
clean build
|
||||
|
||||
APP_PATH="$BUILD_DIR/Build/Products/Release/iKeyMon.app"
|
||||
if [[ ! -d "$APP_PATH" ]]; then
|
||||
echo "❌ Failed to find built app at $APP_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ZIP_NAME="iKeyMon-$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' \"$APP_PATH/Contents/Info.plist\").zip"
|
||||
pushd "$(dirname "$APP_PATH")" >/dev/null
|
||||
zip -r "$ARTIFACTS_DIR/$ZIP_NAME" "$(basename "$APP_PATH")"
|
||||
popd >/dev/null
|
||||
|
||||
echo "✅ Build complete. Artifact: $ARTIFACTS_DIR/$ZIP_NAME"
|
||||
Reference in New Issue
Block a user