11name : Build macOS
22
3+ permissions :
4+ contents : read
5+ packages : write
6+
37on :
48 push :
59 branches : [ master, test-ci ]
610 pull_request :
711 branches : [ master ]
812
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.ref }}
15+ cancel-in-progress : true
16+
917jobs :
1018 build :
1119 name : " Build: ${{ matrix.archname }}"
1220 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"
1330 strategy :
1431 fail-fast : false
1532 matrix :
@@ -34,26 +51,69 @@ jobs:
3451 - name : Install dependencies
3552 run : |
3653 set -e
37- brew install automake autoconf autoconf-archive libtool
54+ brew install automake autoconf autoconf-archive libtool mono
3855
3956 - name : Install latest CMake
4057 uses : lukka/get-cmake@628dd514bed37cb0a609e84a6186cbbaa2fc0140 # latest as of 2025-10-04
4158
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+
4271 - name : Restore artifacts, or setup vcpkg (do not install any package)
4372 uses : lukka/run-vcpkg@b3dd708d38df5c856fe1c18dc0d59ab771f93921 # latest as of 2025-10-04
4473 with :
4574 vcpkgJsonGlob : ' **/gui/qt/vcpkg.json'
4675
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+
47108 - name : Build CEmu ${{ matrix.config }} on macOS ${{ matrix.arch }}
48109 uses : lukka/run-cmake@67c73a83a46f86c4e0b96b741ac37ff495478c38 # latest as of 2025-10-04
49110 with :
50111 cmakeListsTxtPath : ' ${{ github.workspace }}/gui/qt/CMakeLists.txt'
51112 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' ]"
53114 buildPreset : ' Mac-${{ matrix.arch }}-${{ matrix.config }}'
54115 env :
55116 VCPKG_DEFAULT_HOST_TRIPLET : arm64-osx-release
56- VCPKG_FORCE_SYSTEM_BINARIES : 1
57117
58118 - name : Move to temp folder
59119 run : |
0 commit comments