diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml deleted file mode 100644 index d748be2..0000000 --- a/.gitea/workflows/build.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Build macOS App - -on: - push: - branches: - - master - -jobs: - build: - runs-on: - - self-hosted - - macos - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Build release configuration - run: | - xcodebuild \ - -project iKeyMon.xcodeproj \ - -scheme iKeyMon \ - -configuration Release \ - -derivedDataPath build \ - clean build - - - name: Package app bundle - run: | - mkdir -p artifacts - cd build/Build/Products/Release - zip -r "../../../../artifacts/iKeyMon.app.zip" iKeyMon.app - - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: iKeyMon-macos-app - path: artifacts/iKeyMon.app.zip diff --git a/README.md b/README.md index c4e494b..ed00cd6 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,22 @@ iKeyMon is a native macOS app written in SwiftUI that provides live monitoring f ## 🚀 How to Run Clone the repo and open it in [Xcode](https://developer.apple.com/xcode/). You can build and run the app on macOS 14+. - + ``` git clone https://git.24unix.net/tracer/iKeyMon cd iKeyMon open iKeyMon.xcodeproj ``` + +### Local release build + +Use the helper script to produce a zipped `.app` in `dist/`: + +```bash +./scripts/build_release.sh +``` + +It cleans previous artifacts, builds the `Release` configuration, and drops `iKeyMon-.zip` into the `dist` folder (ignored by git). ## 📦 License MIT — see [LICENSE](LICENSE) for details. diff --git a/scripts/build_release.sh b/scripts/build_release.sh new file mode 100755 index 0000000..4f6f433 --- /dev/null +++ b/scripts/build_release.sh @@ -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"