gi: add macOS ARM64 builder

This means we can finally release native arm64 builds of TinyGo on
macOS!

Also update from macOS 11 to macOS 12, because macOS 11 is not supported
anymore.
This commit is contained in:
Ayke van Laethem
2024-02-05 15:12:58 +01:00
committed by Ron Evans
parent 2867da164d
commit 0db1a4bec1
+17 -7
View File
@@ -14,7 +14,17 @@ concurrency:
jobs: jobs:
build-macos: build-macos:
name: build-macos name: build-macos
runs-on: macos-11 strategy:
matrix:
# macos-12: amd64 (oldest supported version as of 05-02-2024)
# macos-14: arm64 (oldest arm64 version)
os: [macos-12, macos-14]
include:
- os: macos-12
goarch: amd64
- os: macos-14
goarch: arm64
runs-on: ${{ matrix.os }}
steps: steps:
- name: Install Dependencies - name: Install Dependencies
shell: bash shell: bash
@@ -33,7 +43,7 @@ jobs:
uses: actions/cache/restore@v3 uses: actions/cache/restore@v3
id: cache-llvm-source id: cache-llvm-source
with: with:
key: llvm-source-17-macos-v1 key: llvm-source-17-${{ matrix.os }}-v1
path: | path: |
llvm-project/clang/lib/Headers llvm-project/clang/lib/Headers
llvm-project/clang/include llvm-project/clang/include
@@ -58,7 +68,7 @@ jobs:
uses: actions/cache/restore@v3 uses: actions/cache/restore@v3
id: cache-llvm-build id: cache-llvm-build
with: with:
key: llvm-build-17-macos-v1 key: llvm-build-17-${{ matrix.os }}-v1
path: llvm-build path: llvm-build
- name: Build LLVM - name: Build LLVM
if: steps.cache-llvm-build.outputs.cache-hit != 'true' if: steps.cache-llvm-build.outputs.cache-hit != 'true'
@@ -82,7 +92,7 @@ jobs:
uses: actions/cache@v3 uses: actions/cache@v3
id: cache-wasi-libc id: cache-wasi-libc
with: with:
key: wasi-libc-sysroot-v5 key: wasi-libc-sysroot-${{ matrix.os }}-v1
path: lib/wasi-libc/sysroot path: lib/wasi-libc/sysroot
- name: Build wasi-libc - name: Build wasi-libc
if: steps.cache-wasi-libc.outputs.cache-hit != 'true' if: steps.cache-wasi-libc.outputs.cache-hit != 'true'
@@ -98,7 +108,7 @@ jobs:
run: make tinygo-test run: make tinygo-test
- name: Make release artifact - name: Make release artifact
shell: bash shell: bash
run: cp -p build/release.tar.gz build/tinygo.darwin-amd64.tar.gz run: cp -p build/release.tar.gz build/tinygo.darwin-${{ matrix.goarch }}.tar.gz
- name: Publish release artifact - name: Publish release artifact
# Note: this release artifact is double-zipped, see: # Note: this release artifact is double-zipped, see:
# https://github.com/actions/upload-artifact/issues/39 # https://github.com/actions/upload-artifact/issues/39
@@ -108,8 +118,8 @@ jobs:
# We're doing the former here, to keep artifact uploads fast. # We're doing the former here, to keep artifact uploads fast.
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: darwin-amd64-double-zipped name: darwin-${{ matrix.goarch }}-double-zipped
path: build/tinygo.darwin-amd64.tar.gz path: build/tinygo.darwin-${{ matrix.goarch }}.tar.gz
- name: Smoke tests - name: Smoke tests
shell: bash shell: bash
run: make smoketest TINYGO=$(PWD)/build/tinygo run: make smoketest TINYGO=$(PWD)/build/tinygo