v0.12.14 #22
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tools | |
| run: pip install build | |
| - 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 \ | |
| -framework UserNotifications \ | |
| -lsqlite3 \ | |
| -O \ | |
| -target ${{ matrix.arch }}-apple-macosx12.0 | |
| - name: Create .app bundle | |
| run: | | |
| APP="cc_stats_app/swift/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 cc_stats_app/swift/CCStats.app CCStats-${{ matrix.arch }}.zip | |
| - name: Build platform wheel | |
| run: | | |
| python scripts/build_wheels.py --skip-compile --arch ${{ matrix.arch }} --platform-only | |
| - name: Upload zip to Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release upload ${{ github.event.release.tag_name }} \ | |
| CCStats-${{ matrix.arch }}.zip \ | |
| --clobber | |
| - name: Upload platform wheel to Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| WHL=$(ls dist/cc_statistics-*-macosx_12_0_${{ matrix.arch }}.whl) | |
| gh release upload ${{ github.event.release.tag_name }} \ | |
| "$WHL" \ | |
| --clobber |