Add GitHub Actions for automated DMG builds
Some checks failed
Build and Release / Build DMG for arm64 (push) Has been cancelled
Build and Release / Build DMG for x86_64 (push) Has been cancelled
Build and Release / Create Release (push) Has been cancelled

Features:
- Build DMG for both arm64 (Apple Silicon) and x86_64 (Intel)
- Automatic release creation when tags are pushed
- Multi-architecture support using matrix strategy
- Upload artifacts to GitHub releases

Workflow:
1. Triggered only on tag push (e.g., v1.0.0)
2. Build job: Compiles for arm64 and x86_64 in parallel
3. Release job: Creates GitHub release with both DMGs

Build Scripts Updates:
- Support VERSION environment variable
- Dynamic version in Info.plist
- Dynamic version in DMG filename

Release Artifacts:
- uskey-v{version}-arm64.dmg (Apple Silicon)
- uskey-v{version}-x86_64.dmg (Intel)

Files:
- .github/workflows/release.yml: CI/CD workflow
- build-app.sh: Support VERSION env var
- build-dmg.sh: Support VERSION env var

Usage:

🤖 Generated with [Qoder](https://qoder.com)
This commit is contained in:
loveuer
2025-12-02 22:07:13 +08:00
parent 72fd1ef2d6
commit 6e4090b53e
3 changed files with 149 additions and 5 deletions

View File

@@ -2,11 +2,11 @@
set -e
APP_NAME="uskey"
VERSION="1.0.0"
VERSION="${VERSION:-1.0.0}"
BUILD_DIR=".build/release"
APP_DIR="$BUILD_DIR/$APP_NAME.app"
DMG_DIR=".build/dmg"
DMG_NAME="$APP_NAME-$VERSION.dmg"
DMG_NAME="$APP_NAME-v$VERSION.dmg"
DMG_TEMP="$DMG_DIR/temp.dmg"
DMG_FINAL="$BUILD_DIR/$DMG_NAME"
@@ -15,7 +15,7 @@ if [ ! -d "$APP_DIR" ]; then
exit 1
fi
echo "Creating DMG for $APP_NAME..."
echo "Creating DMG for $APP_NAME v$VERSION..."
echo "Step 1: Preparing DMG directory..."
rm -rf "$DMG_DIR"
@@ -78,4 +78,4 @@ echo ""
echo "To install:"
echo " 1. Open $DMG_FINAL"
echo " 2. Drag $APP_NAME.app to Applications folder"
echo " 3. Run from Applications or Spotlight"
echo " 3. Run from Applications or Spotlight"