From 8e5d78734f7e80983b9d289e096f294bdcde904b Mon Sep 17 00:00:00 2001 From: Lev Khoroshansky Date: Sun, 8 Feb 2026 18:32:05 +0100 Subject: [PATCH] ci: macOS artifacts (ZIP) + Intel runner + ccache Issue #1403 checklist: - Output binaries for macOS builds: run CPack on macOS and upload the resulting openxray*.zip as a workflow artifact. What this change does: - Add a minimal macOS matrix: macos-latest (arm64) + macos-15-intel (x86_64). - Force -DCPACK_GENERATOR=ZIP on macOS for deterministic packaging. - Speed/stability: install ccache and cache ~/.ccache; disable Homebrew auto-updates via HOMEBREW_NO_AUTO_UPDATE. Note: - This does NOT build a single universal2 binary (CMAKE_OSX_ARCHITECTURES=arm64;x86_64). That part of #1403 remains TODO. --- .github/workflows/cibuild.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index d70d39218db..a22d2344950 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -81,6 +81,7 @@ jobs: env: CFLAGS: "-w" CXXFLAGS: "-w" + HOMEBREW_NO_AUTO_UPDATE: 1 strategy: fail-fast: false @@ -99,7 +100,9 @@ jobs: - { name: Alpine, os: ubuntu-latest, arch: x86, cc: gcc, shell: 'alpine.sh {0}', flags: "-DXRAY_LINKER=mold", } - { name: Fedora, os: ubuntu-latest, arch: x86_64, cc: gcc, container: 'fedora:latest', } #- { name: Haiku, os: ubuntu-latest, arch: x86_64, cc: x86_64-unknown-haiku-gcc, cxx: x86_64-unknown-haiku-g++, container: 'haiku/cross-compiler:x86_64-r1beta4', } - - { name: macOS, os: macos-latest, arch: arm64, cc: clang, threads: 3 } + # macOS images have tighter concurrency limits; keep the matrix minimal. + - { name: macOS, os: macos-latest, arch: arm64, cc: clang, threads: 3, flags: "-DCPACK_GENERATOR=ZIP" } + - { name: macOS Intel, os: macos-15-intel, arch: x86_64, cc: clang, flags: "-DCMAKE_OSX_ARCHITECTURES=x86_64 -DCPACK_GENERATOR=ZIP" } configuration: [Debug, Mixed, Release, ReleaseMasterGold] @@ -133,8 +136,7 @@ jobs: - name: Install macOS packages if: ${{ startsWith(matrix.platform.name, 'macOS') }} run: | - brew update - brew install sdl2 lzo libogg libvorbis theora + brew install ccache cmake sdl2 lzo libogg libvorbis theora openal-soft jpeg-turbo - name: Install Fedora packages if: ${{ matrix.platform.name == 'Fedora' }} @@ -150,6 +152,16 @@ jobs: with: submodules: recursive + - name: Restore ccache + if: ${{ startsWith(matrix.platform.name, 'macOS') }} + uses: actions/cache@main + with: + path: ~/.ccache + key: ccache-${{ runner.os }}-${{ matrix.platform.arch }}-${{ matrix.configuration }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**/CMakeLists.txt', 'Externals/**/CMakeLists.txt') }} + restore-keys: | + ccache-${{ runner.os }}-${{ matrix.platform.arch }}-${{ matrix.configuration }}- + ccache-${{ runner.os }}-${{ matrix.platform.arch }}- + - name: Run CMake run: cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_UNITY_BUILD=ON ${{ matrix.platform.flags }} --log-level VERBOSE @@ -157,6 +169,10 @@ jobs: id: cmake-build run: cmake --build build --config ${{ matrix.configuration }} --parallel ${{ matrix.platform.threads || 4 }} + - name: Show ccache stats + if: ${{ startsWith(matrix.platform.name, 'macOS') }} + run: ccache -s || true + - name: Make package if: ${{ steps.cmake-build.outcome == 'success' }} id: make-package