From 7022eca36b114cec47948472a50abec8bfc9f1a8 Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Tue, 9 Jun 2026 20:48:09 -0500 Subject: [PATCH] More MacOS CI iteration (#6382) --- .github/macports.yml | 23 ++++++++++++ .github/workflows/generate-builds.yml | 54 +++++---------------------- .github/workflows/gtar | 2 - .github/workflows/macports-deps.txt | 1 - 4 files changed, 32 insertions(+), 48 deletions(-) create mode 100644 .github/macports.yml delete mode 100644 .github/workflows/gtar delete mode 100644 .github/workflows/macports-deps.txt diff --git a/.github/macports.yml b/.github/macports.yml new file mode 100644 index 0000000000..de075020de --- /dev/null +++ b/.github/macports.yml @@ -0,0 +1,23 @@ +ports: + - name: libsdl2 + select: [ universal ] + - name: libsdl2_net + select: [ universal ] + - name: libpng + select: [ universal ] + - name: glew + select: [ universal ] + - name: libzip + select: [ universal ] + - name: nlohmann-json + select: [ universal ] + - name: tinyxml2 + select: [ universal ] + - name: libogg + select: [ universal ] + - name: libopus + select: [ universal ] + - name: opusfile + select: [ universal ] + - name: libvorbis + select: [ universal ] \ No newline at end of file diff --git a/.github/workflows/generate-builds.yml b/.github/workflows/generate-builds.yml index ab6335a362..17b351c096 100644 --- a/.github/workflows/generate-builds.yml +++ b/.github/workflows/generate-builds.yml @@ -82,46 +82,17 @@ jobs: uses: actions/checkout@v6 with: submodules: true + - name: Setup Macports + uses: melusina-org/setup-macports@v1 + with: + parameters: '.github/macports.yml' - name: Configure ccache uses: hendrikmuhs/ccache-action@v1.2.22 with: - create-symlink: true + key: ${{ runner.os }} # ccache-macos-{{ timestamp }} + max-size: "2G" + evict-old-files: job save: ${{ github.ref_name == github.event.repository.default_branch }} - key: ${{ runner.os }}-14-ccache-${{ github.ref }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-14-ccache-${{ github.ref }} - ${{ runner.os }}-14-ccache - # Needed to apply sudo for macports cache restore - - name: Install gtar wrapper - run: | - sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig - sudo cp .github/workflows/gtar /opt/homebrew/bin/gtar - sudo chmod +x /opt/homebrew/bin/gtar - - name: Restore Cached MacPorts - id: restore-cache-macports - uses: actions/cache/restore@v5 - with: - key: ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}- - ${{ runner.os }}-14-macports- - path: /opt/local/ - # Updated PATH applies to the next step and onwards - - name: Install MacPorts (if necessary) - run: | - if command -v /opt/local/bin/port 2>&1 >/dev/null; then - echo "MacPorts already installed" - else - echo "Installing MacPorts" - wget https://github.com/macports/macports-base/releases/download/v2.11.5/MacPorts-2.11.5-14-Sonoma.pkg - sudo installer -pkg ./MacPorts-2.11.5-14-Sonoma.pkg -target / - fi - echo "/opt/local/bin:/opt/local/sbin" >> "$GITHUB_PATH" - - name: Install dependencies - run: | - brew uninstall --ignore-dependencies libpng - sudo port install $(cat .github/workflows/macports-deps.txt) - brew install ninja - name: Download soh.o2r uses: actions/download-artifact@v7 with: @@ -129,9 +100,8 @@ jobs: path: build-cmake/soh - name: Build SoH run: | - export PATH="/usr/lib/ccache:/opt/homebrew/opt/ccache/libexec:/usr/local/opt/ccache/libexec:$PATH" - cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DBUILD_REMOTE_CONTROL=1 - cmake --build build-cmake --config Release --parallel 10 + cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DBUILD_REMOTE_CONTROL=1 + cmake --build build-cmake -j (cd build-cmake && cpack) mv _packages/*.dmg SoH.dmg @@ -143,12 +113,6 @@ jobs: path: | SoH.dmg readme.txt - - name: Save Cache MacPorts - if: ${{ github.ref_name == github.event.repository.default_branch }} - uses: actions/cache/save@v5 - with: - key: ${{ steps.restore-cache-macports.outputs.cache-primary-key }} - path: /opt/local/ build-linux: needs: generate-soh-otr diff --git a/.github/workflows/gtar b/.github/workflows/gtar deleted file mode 100644 index cf64d0281e..0000000000 --- a/.github/workflows/gtar +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec sudo /opt/homebrew/bin/gtar.orig "$@" diff --git a/.github/workflows/macports-deps.txt b/.github/workflows/macports-deps.txt deleted file mode 100644 index fd97d0c306..0000000000 --- a/.github/workflows/macports-deps.txt +++ /dev/null @@ -1 +0,0 @@ -libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal tinyxml2 +universal libogg +universal libopus +universal opusfile +universal libvorbis +universal \ No newline at end of file