Replace CI build with local release script

This commit is contained in:
Micha
2025-11-19 23:55:18 +01:00
parent f6c4773ac7
commit 726df91d2d
3 changed files with 42 additions and 37 deletions

View File

@@ -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

View File

@@ -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-<version>.zip` into the `dist` folder (ignored by git).
## 📦 License
MIT — see [LICENSE](LICENSE) for details.

31
scripts/build_release.sh Executable file
View 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"