From 84e2b768e49b3a58c5fc444beca5eef7174e6880 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sat, 9 Nov 2024 13:08:10 -0500 Subject: [PATCH] ci: adjust builds to also build the ARM binaries --- .github/workflows/build-matrix.yaml | 14 ++++++-------- .github/workflows/macos-build-arm.yaml | 2 +- .github/workflows/release-pipeline.yaml | 25 ++++++++++++++++++++++++- CMakeLists.txt | 1 + CMakePresets.json | 9 +++++++++ 5 files changed, 41 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-matrix.yaml b/.github/workflows/build-matrix.yaml index 59601c577..a3d83d7d1 100644 --- a/.github/workflows/build-matrix.yaml +++ b/.github/workflows/build-matrix.yaml @@ -52,11 +52,9 @@ jobs: cmakePreset: "Release-macos-clang" cachePrefix: "" - # Q4 2023 there will hopefully be native arm64 runners - # https://github.com/github/roadmap/issues/528 - # build_macos_arm: - # name: "🍎 MacOS" - # uses: ./.github/workflows/macos-build-arm.yaml - # with: - # cmakePreset: "Release-macos-clang" - # cachePrefix: "" + build_macos_arm: + name: "🍎 MacOS" + uses: ./.github/workflows/macos-build-arm.yaml + with: + cmakePreset: "Release-macos-rosetta-clang" + cachePrefix: "" diff --git a/.github/workflows/macos-build-arm.yaml b/.github/workflows/macos-build-arm.yaml index 032dd27fb..23cb63cdc 100644 --- a/.github/workflows/macos-build-arm.yaml +++ b/.github/workflows/macos-build-arm.yaml @@ -52,7 +52,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: opengoal-macos-${{ inputs.cachePrefix }} + name: opengoal-macos-arm-${{ inputs.cachePrefix }} if-no-files-found: error path: | ./build/goalc/goalc diff --git a/.github/workflows/release-pipeline.yaml b/.github/workflows/release-pipeline.yaml index d1aa0244f..cd29a9aef 100644 --- a/.github/workflows/release-pipeline.yaml +++ b/.github/workflows/release-pipeline.yaml @@ -79,6 +79,17 @@ jobs: uploadArtifacts: true secrets: inherit + build_macos_arm: + needs: + - cut_release + name: "🍎 MacOS" + uses: ./.github/workflows/macos-build.yaml + with: + cmakePreset: "Release-macos-rosetta-clang-static" + cachePrefix: "static" + uploadArtifacts: true + secrets: inherit + # Upload the Artifacts upload_artifacts: if: github.repository == 'open-goal/jak-project' @@ -87,6 +98,7 @@ jobs: - build_windows_clang - build_linux_clang - build_macos_intel + - build_macos_arm name: "Upload Artifacts" runs-on: ubuntu-latest steps: @@ -124,7 +136,7 @@ jobs: 7z a -tzip ./ci-artifacts/final/opengoal-windows-${TAG_VAL}.zip ./ci-artifacts/windows/* cp ./ci-artifacts/opengoal-windows-static/lsp.exe ./ci-artifacts/final/opengoal-lsp-windows-${TAG_VAL}.exe - - name: Prepare macOS Build Assets + - name: Prepare Intel macOS Build Assets run: | mkdir -p ./ci-artifacts/macos ./.github/scripts/releases/extract_build_unix.sh ./ci-artifacts/macos ./ci-artifacts/opengoal-macos-static ./ @@ -135,6 +147,17 @@ jobs: chmod +x ./ci-artifacts/opengoal-macos-static/lsp/lsp cp ./ci-artifacts/opengoal-macos-static/lsp/lsp ./ci-artifacts/final/opengoal-lsp-macos-intel-${TAG_VAL}.bin + - name: Prepare ARM macOS Build Assets + run: | + mkdir -p ./ci-artifacts/macos-arm + ./.github/scripts/releases/extract_build_unix.sh ./ci-artifacts/macos-arm ./ci-artifacts/opengoal-macos-arm-static ./ + pushd ci-artifacts/macos-arm + TAG_VAL=${{ needs.cut_release.outputs.new_tag }} + tar czf ../final/opengoal-macos-arm-${TAG_VAL}.tar.gz . + popd + chmod +x ./ci-artifacts/opengoal-macos-arm-static/lsp/lsp + cp ./ci-artifacts/opengoal-macos-arm-static/lsp/lsp ./ci-artifacts/final/opengoal-lsp-macos-arm-${TAG_VAL}.bin + - name: Upload Assets env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CMakeLists.txt b/CMakeLists.txt index ba072d651..1cb218f0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.10) set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) project(jak) include(CTest) diff --git a/CMakePresets.json b/CMakePresets.json index ee5a09198..1ff3b0a1f 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -164,6 +164,15 @@ "description": "Build with Clang as Release without Debug Symbols", "inherits": ["base-macos-release", "base-clang"] }, + { + "name": "Release-macos-rosetta-clang", + "displayName": "MacOS Release Rosetta (clang)", + "description": "Build with Clang as Release without Debug Symbols", + "inherits": ["base-macos-release", "base-clang"], + "cacheVariables": { + "BUILD_X86_ON_MACOS": "ON" + } + }, { "name": "Release-macos-clang-static", "displayName": "MacOS Static Release (clang)",