mirror of
https://github.com/VGEAREN/Stockbar.git
synced 2026-10-06 15:04:05 +08:00
Add GitHub Actions workflow for tag-triggered DMG release
Builds Universal Binary (arm64 + x86_64), packages DMG with hdiutil, and uploads as GitHub Release artifact when a v* tag is pushed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
6b1f565d7d
commit
75a8da5436
@@ -0,0 +1,62 @@
|
||||
name: Release DMG
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Select Xcode
|
||||
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
|
||||
|
||||
- name: Build Universal Binary
|
||||
run: |
|
||||
xcodebuild \
|
||||
-project StockMonitor/StockMonitor.xcodeproj \
|
||||
-scheme StockMonitor \
|
||||
-configuration Release \
|
||||
-derivedDataPath build \
|
||||
ARCHS="arm64 x86_64" \
|
||||
ONLY_ACTIVE_ARCH=NO \
|
||||
CODE_SIGN_IDENTITY="-" \
|
||||
CODE_SIGNING_REQUIRED=NO \
|
||||
CODE_SIGNING_ALLOWED=NO
|
||||
|
||||
- name: Locate .app
|
||||
id: locate
|
||||
run: |
|
||||
APP_PATH=$(find build -name "StockMonitor.app" -maxdepth 6 | head -1)
|
||||
echo "app_path=$APP_PATH" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create DMG
|
||||
run: |
|
||||
APP_PATH="${{ steps.locate.outputs.app_path }}"
|
||||
VERSION="${GITHUB_REF_NAME}"
|
||||
DMG_NAME="StockMonitor-${VERSION}.dmg"
|
||||
|
||||
mkdir -p dmg_staging
|
||||
cp -R "$APP_PATH" dmg_staging/
|
||||
|
||||
hdiutil create \
|
||||
-volname "StockMonitor ${VERSION}" \
|
||||
-srcfolder dmg_staging \
|
||||
-ov \
|
||||
-format UDZO \
|
||||
"$DMG_NAME"
|
||||
|
||||
echo "DMG created: $DMG_NAME"
|
||||
|
||||
- name: Upload Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: StockMonitor-*.dmg
|
||||
generate_release_notes: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user