Repository navigation
58 lines (48 loc) · 1.75 KB
/
Copy pathbuild.yml
File metadata and controls
58 lines (48 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Build & Test
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
build:
runs-on: macos-15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for git describe in snapshot versioning
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.2'
- name: Cache SPM packages
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Resolve dependencies
run: swift package resolve
- name: Run tests
run: swift test
- name: Build (release)
run: swift build -c release
- name: Assemble .app (smoke test)
run: |
# Assemble the .app bundle to catch Info.plist, resource, or
# code-signing issues early. No credentials are injected —
# placeholder values are fine for CI validation.
./bundle_app.sh
echo " ✓ BusinessBar.app assembled successfully"
- name: Verify .app bundle
run: |
codesign --verify --deep --strict BusinessBar.app
echo " ✓ Code signature verified"
# Sanity-check that version was written by snapshot versioning.
# PlistBuddy reads the file directly — more reliable than
# `defaults read` which fails in CI environments.
VERSION=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" BusinessBar.app/Contents/Info.plist)
BUILD=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" BusinessBar.app/Contents/Info.plist)
echo " ✓ Version: ${VERSION} (build ${BUILD})"