Skip to content

v0.12.5

v0.12.5 #13

Workflow file for this run

name: Build macOS App
on:
release:
types: [published]
permissions:
contents: write
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
arch: [arm64, x86_64]
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: |
TAG="${{ github.event.release.tag_name }}"
VERSION="${TAG#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Prepare Info.plist
run: |
sed "s/__VERSION__/${{ steps.version.outputs.version }}/g" \
cc_stats_app/swift/Info.plist > Info.plist.tmp
- name: Build for ${{ matrix.arch }}
run: |
find cc_stats_app/swift -name "*.swift" -print0 | sort -z | \
xargs -0 swiftc \
-o CCStats \
-framework Cocoa \
-framework SwiftUI \
-framework Carbon \
-lsqlite3 \
-O \
-target ${{ matrix.arch }}-apple-macosx13.0
- name: Create .app bundle
run: |
APP="CCStats.app"
mkdir -p "$APP/Contents/MacOS"
mkdir -p "$APP/Contents/Resources"
cp -R cc_stats_app/swift/Resources/clawd "$APP/Contents/Resources/clawd" 2>/dev/null || true
cp Info.plist.tmp "$APP/Contents/Info.plist"
mv CCStats "$APP/Contents/MacOS/CCStats"
chmod +x "$APP/Contents/MacOS/CCStats"
- name: Package as zip (preserves permissions)
run: |
ditto -c -k --keepParent CCStats.app CCStats-${{ matrix.arch }}.zip
- name: Upload to Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload ${{ github.event.release.tag_name }} \
CCStats-${{ matrix.arch }}.zip \
--clobber