From cfe7686ca6459c635b5e45bf2a92cb2be06cd6e7 Mon Sep 17 00:00:00 2001 From: Cory Knox Date: Fri, 6 Nov 2026 13:43:36 -0700 Subject: [PATCH] (#3785) Run macOS Builds on macos-latest The macos-14 runner images were retired from GitHub Actions on November 2, 2026, so the macOS jobs pinned to them can no longer run. The macos-latest image is Arm64 and does not include Mono. Install Mono from the official universal package, which runs as x64 under Rosetta. Homebrew's Mono runs Arm-native, where the LibGit2Sharp 0.27 used by Cake.Git cannot load, as it has no osx-arm64 library. Also include the runner architecture in the tools cache key, so tools restored on one architecture are never run on another. --- .github/workflows/build.yml | 13 +++++++++++-- .github/workflows/test.yml | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5d2b38d3b..6462f82c5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,7 +94,7 @@ jobs: code_drop\MSIs\en-US\chocolatey-*.msi # Build using mono on MacOS macos-build: - runs-on: macos-14 + runs-on: macos-latest steps: - uses: actions/checkout@v3 with: @@ -103,7 +103,16 @@ jobs: uses: actions/cache@v4 with: path: tools - key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} + # tools contains architecture-specific binaries, so Arm64 and x64 runners can't share a cache. + key: ${{ runner.os }}-${{ runner.arch }}-tools-${{ hashFiles('recipe.cake') }} + # Official universal package, which runs Mono as x64 under Rosetta, rather than Homebrew's Arm-native + # Mono: the LibGit2Sharp 0.27 used by Cake.Git has no osx-arm64 native library. + - name: Install Mono + run: | + curl -fsSL -o "$RUNNER_TEMP/mono.pkg" https://download.mono-project.com/archive/6.12.0/macos-10-universal/MonoFramework-MDK-6.12.0.206.macos10.xamarin.universal.pkg + sudo installer -pkg "$RUNNER_TEMP/mono.pkg" -target / + echo "/Library/Frameworks/Mono.framework/Versions/Current/Commands" >> "$GITHUB_PATH" + /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono --version - name: Install dotnet #needed for GitVersion uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a57ce46c27..559fe811c8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -87,7 +87,7 @@ jobs: code_drop\MsBuild.log # Build and test using mono on MacOS macos-build: - runs-on: macos-14 + runs-on: macos-latest steps: - uses: actions/checkout@v3 with: @@ -96,7 +96,16 @@ jobs: uses: actions/cache@v4 with: path: tools - key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} + # tools contains architecture-specific binaries, so Arm64 and x64 runners can't share a cache. + key: ${{ runner.os }}-${{ runner.arch }}-tools-${{ hashFiles('recipe.cake') }} + # Official universal package, which runs Mono as x64 under Rosetta, rather than Homebrew's Arm-native + # Mono: the LibGit2Sharp 0.27 used by Cake.Git has no osx-arm64 native library. + - name: Install Mono + run: | + curl -fsSL -o "$RUNNER_TEMP/mono.pkg" https://download.mono-project.com/archive/6.12.0/macos-10-universal/MonoFramework-MDK-6.12.0.206.macos10.xamarin.universal.pkg + sudo installer -pkg "$RUNNER_TEMP/mono.pkg" -target / + echo "/Library/Frameworks/Mono.framework/Versions/Current/Commands" >> "$GITHUB_PATH" + /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono --version - name: Install dotnet #needed for GitVersion uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5 with: