Replace CI build with local release script
This commit is contained in:
@@ -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
|
|
||||||
10
README.md
10
README.md
@@ -36,6 +36,16 @@ git clone https://git.24unix.net/tracer/iKeyMon
|
|||||||
cd iKeyMon
|
cd iKeyMon
|
||||||
open iKeyMon.xcodeproj
|
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
|
## 📦 License
|
||||||
|
|
||||||
MIT — see [LICENSE](LICENSE) for details.
|
MIT — see [LICENSE](LICENSE) for details.
|
||||||
|
|||||||
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