diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f6fb7684..c5d479018 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -238,6 +238,46 @@ jobs: name: macOS DMG${{matrix.suffix}} x86_64 path: build/*.dmg + macos-arm64: + runs-on: ubuntu-22.04 + name: 🍎 macOS 12.1 arm64 + steps: + - name: 🧰 Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: 📁 Restore docker /cache + uses: actions/cache@v3 + with: + path: cache + key: build-macos-arm64-cache + + - name: 🐳 Inject /cache into docker + uses: reproducible-containers/buildkit-cache-dance@v2.1.2 # Doesn't work with a MacOS runner ? + with: + cache-source: cache + cache-target: /cache + + - name: 🛠️ Build using docker + run: | + docker buildx build . -f dist/macOS/arm64.Dockerfile --progress=plain --build-arg 'JOBS=4' --build-arg "BUILD_TYPE=$(BUILD_TYPE)" --build-context imhex=$(pwd) --output out + + - name: ⬆️ Upload artifacts + uses: actions/upload-pages-artifact@v2 + with: + name: macOS ZIP arm64 + path: out/ + + # See https://github.com/actions/cache/issues/342#issuecomment-1711054115 + - name: 🗑️ Delete old cache + continue-on-error: true + env: + GH_TOKEN: ${{ github.token }} + run: | + gh extension install actions/gh-actions-cache + gh actions-cache delete "build-macos-arm64-cache" --confirm + # Ubuntu build ubuntu: strategy: diff --git a/dist/macOS/arm64.Dockerfile b/dist/macOS/arm64.Dockerfile index bd80ad8eb..e3d4ce2e2 100644 --- a/dist/macOS/arm64.Dockerfile +++ b/dist/macOS/arm64.Dockerfile @@ -1,5 +1,5 @@ -# see arm64.crosscompile.Dockerfile -FROM crosscompile as build +# This base image is also known as "crosscompile". See arm64.crosscompile.Dockerfile +FROM ghcr.io/itrooz/macos-crosscompile:clang17-nosdk as build ENV MACOSX_DEPLOYMENT_TARGET 12.1 @@ -22,8 +22,16 @@ if [ "$CUSTOM_GLFW" ]; then fi EOF -## Assume the SDK has been removed from the image, and copy it again -COPY SDK /osxcross/target/SDK +RUN --mount=type=cache,target=/cache <