1
1
name : Build macOS
2
2
3
+ permissions :
4
+ contents : read
5
+ packages : write
6
+
3
7
on :
4
8
push :
5
9
branches : [ master, test-ci ]
6
10
pull_request :
7
11
branches : [ master ]
8
12
13
+ concurrency :
14
+ group : ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress : true
16
+
9
17
jobs :
10
18
build :
11
19
name : " Build: ${{ matrix.archname }}"
12
20
runs-on : macos-14
21
+ env :
22
+ VCPKG_FEATURE_FLAGS : manifests,binarycaching
23
+ VCPKG_BINARY_SOURCES : ${{ format('clear;nuget,https://nuget.pkg.github.com/{0}/index.json,{1}', github.repository_owner, github.event_name == 'pull_request' && 'read' || 'readwrite') }}
24
+ VCPKG_NUGET_REPOSITORY : https://github.com/${{ github.repository }}.git
25
+ VCPKG_DOWNLOADS : ${{ github.workspace }}/.vcpkg-downloads
26
+ VCPKG_FORCE_DOWNLOADED_BINARIES : " 1"
27
+ SCCACHE_GHA_ENABLED : " true"
28
+ HOMEBREW_NO_AUTO_UPDATE : " 1"
29
+ HOMEBREW_NO_INSTALL_CLEANUP : " 1"
13
30
strategy :
14
31
fail-fast : false
15
32
matrix :
@@ -34,26 +51,69 @@ jobs:
34
51
- name : Install dependencies
35
52
run : |
36
53
set -e
37
- brew install automake autoconf autoconf-archive libtool
54
+ brew install automake autoconf autoconf-archive libtool mono
38
55
39
56
- name : Install latest CMake
40
57
uses : lukka/get-cmake@628dd514bed37cb0a609e84a6186cbbaa2fc0140 # latest as of 2025-10-04
41
58
59
+ - name : Ensure vcpkg downloads directory exists
60
+ run : |
61
+ mkdir -p "$VCPKG_DOWNLOADS"
62
+
63
+ - name : Cache vcpkg downloads
64
+ uses : actions/cache@v4
65
+ with :
66
+ path : ${{ env.VCPKG_DOWNLOADS }}
67
+ key : ${{ runner.os }}-vcpkg-downloads-${{ hashFiles('gui/qt/vcpkg.json', 'gui/qt/vcpkg-configuration.json') }}
68
+ restore-keys : |
69
+ ${{ runner.os }}-vcpkg-downloads-
70
+
42
71
- name : Restore artifacts, or setup vcpkg (do not install any package)
43
72
uses : lukka/run-vcpkg@b3dd708d38df5c856fe1c18dc0d59ab771f93921 # latest as of 2025-10-04
44
73
with :
45
74
vcpkgJsonGlob : ' **/gui/qt/vcpkg.json'
46
75
76
+ - name : Download nuget.exe and export to env
77
+ shell : bash
78
+ run : |
79
+ set -euo pipefail
80
+ curl -sSL -o "$RUNNER_TEMP/nuget.exe" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
81
+ echo "NUGET=$RUNNER_TEMP/nuget.exe" >> "$GITHUB_ENV"
82
+
83
+ - name : Provide working 'nuget' on PATH
84
+ shell : bash
85
+ run : |
86
+ set -euo pipefail
87
+ printf '#!/usr/bin/env bash\nexec mono "$NUGET" "$@"\n' > "$RUNNER_TEMP/nuget"
88
+ chmod +x "$RUNNER_TEMP/nuget"
89
+ echo "PATH=$RUNNER_TEMP:$PATH" >> "$GITHUB_ENV"
90
+
91
+ - name : Configure vcpkg NuGet source
92
+ shell : bash
93
+ run : |
94
+ set -euo pipefail
95
+ mono "$NUGET" sources remove -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" || true
96
+ mono "$NUGET" sources add -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
97
+ -Username "${{ github.repository_owner }}" \
98
+ -Password "${{ secrets.GITHUB_TOKEN }}" \
99
+ -StorePasswordInClearText
100
+
101
+ if [[ "${{ github.event_name }}" != "pull_request" ]]; then
102
+ mono "$NUGET" setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
103
+ fi
104
+
105
+ - name : Start sccache
106
+ uses :
mozilla-actions/[email protected]
107
+
47
108
- name : Build CEmu ${{ matrix.config }} on macOS ${{ matrix.arch }}
48
109
uses : lukka/run-cmake@67c73a83a46f86c4e0b96b741ac37ff495478c38 # latest as of 2025-10-04
49
110
with :
50
111
cmakeListsTxtPath : ' ${{ github.workspace }}/gui/qt/CMakeLists.txt'
51
112
configurePreset : ' Mac-${{ matrix.arch }}'
52
- configurePresetAdditionalArgs : " ['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0']"
113
+ configurePresetAdditionalArgs : " ['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0', '-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache' ]"
53
114
buildPreset : ' Mac-${{ matrix.arch }}-${{ matrix.config }}'
54
115
env :
55
116
VCPKG_DEFAULT_HOST_TRIPLET : arm64-osx-release
56
- VCPKG_FORCE_SYSTEM_BINARIES : 1
57
117
58
118
- name : Move to temp folder
59
119
run : |
0 commit comments