Skip to content

Commit 9d7225a

Browse files
committed
CI
1 parent 4699064 commit 9d7225a

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

.github/workflows/build-macos.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build macOS
2+
3+
# Runs on every push and pull request. Produces an ad-hoc-signed .dmg as an
4+
# artifact for smoke testing. This workflow INTENTIONALLY never reads any
5+
# repo secrets — that's the "build" side of the build/release split. Signed
6+
# Developer ID release builds live in a separate workflow that only fires
7+
# on mac-v* tag pushes and is gated on a GitHub Environment. Keeping the
8+
# split structural (two files, clean separation of concerns) means a
9+
# compromised PR or a mistake in this file cannot exfiltrate the signing
10+
# cert — it doesn't have it in scope at all.
11+
12+
on:
13+
push:
14+
pull_request:
15+
16+
# Minimal token scope. We don't push, we don't comment, we don't create
17+
# releases — just a read of the repo to check out code.
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
build:
23+
name: Build and ad-hoc sign
24+
runs-on: macos-14 # Apple Silicon — our only target
25+
timeout-minutes: 90 # first run will be slow (full vcpkg build)
26+
27+
env:
28+
# Route vcpkg binary cache through GitHub Actions cache. First run
29+
# populates the cache (slow: ~30-60 min to build ANGLE + LuaJIT +
30+
# imaging deps from source). Subsequent runs reuse it and should be
31+
# under 10 min.
32+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
33+
34+
steps:
35+
- name: Checkout (with submodules)
36+
uses: actions/checkout@v4
37+
with:
38+
submodules: recursive
39+
40+
# vcpkg's x-gha binary cache provider reads ACTIONS_CACHE_URL and
41+
# ACTIONS_RUNTIME_TOKEN from the environment. GitHub Actions sets
42+
# them inside the runner but they're not exposed to child processes
43+
# by default, so we export them explicitly here. (Standard dance
44+
# documented in the vcpkg GitHub Actions integration guide.)
45+
- name: Export Actions Cache env vars for vcpkg
46+
uses: actions/github-script@v7
47+
with:
48+
script: |
49+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
50+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
51+
52+
- name: Configure
53+
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
54+
55+
- name: Build
56+
run: cmake --build build
57+
58+
- name: Install to staging dir
59+
run: cmake --install build --prefix "${{ runner.temp }}/pob-install-wrapper"
60+
61+
- name: Ad-hoc sign
62+
run: macos/sign.sh "${{ runner.temp }}/pob-install-wrapper/Path of Building.app"
63+
64+
- name: Verify signature
65+
run: codesign --verify --deep --strict --verbose=2 "${{ runner.temp }}/pob-install-wrapper/Path of Building.app"
66+
67+
- name: Package DMG
68+
run: macos/make-dmg.sh "${{ runner.temp }}/pob-install-wrapper/Path of Building.app" "${{ runner.temp }}/Path of Building.dmg"
69+
70+
- name: Upload DMG artifact
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: pob-mac-${{ github.sha }}
74+
path: ${{ runner.temp }}/Path of Building.dmg
75+
if-no-files-found: error

0 commit comments

Comments
 (0)