ci(release): replace darwin/amd64 matrix entry with darwin/universal lipo build (#2)

GitHub-hosted macos-13 (Intel) runners are not reliably available in
the praetorian-inc org's pool, so the v1.0.1 release's darwin/amd64
matrix entry sat queued indefinitely and blocked the release job.

Replace the two separate darwin matrix entries (amd64 + arm64) with a
single darwin/universal entry that runs on macos-latest (ARM64) and:

1. Builds darwin/arm64 natively (CGO clang targets host).
2. Cross-builds darwin/amd64 via `clang -arch x86_64` — the macOS SDK
   on GitHub-hosted ARM runners is universal, so x86_64 mach-O slices
   link without any extra SDK install.
3. Combines both into a fat mach-O with `lipo -create`, uploaded as
   `wasmforge-darwin-universal`.

Net change for downstream users: one binary instead of two for macOS,
and it Just Works on both Intel and Apple Silicon. linux/amd64 and
windows/amd64 matrix entries are unchanged.

This fix needs to be cherry-picked into wasmforge-internal so future
syncs don't reintroduce the macos-13 dependency.
This commit is contained in:
michaelweber
2026-06-16 15:42:19 -04:00
committed by GitHub
parent 4baf319f98
commit 541b4f001c
+17 -6
View File
@@ -45,11 +45,7 @@ jobs:
ext: .exe
runs-on: windows-latest
- goos: darwin
goarch: amd64
ext: ''
runs-on: macos-13
- goos: darwin
goarch: arm64
goarch: universal
ext: ''
runs-on: macos-latest
steps:
@@ -67,7 +63,8 @@ jobs:
name: build-assets
path: internal/build
- name: Build
- name: Build (single arch)
if: matrix.goarch != 'universal'
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
@@ -75,6 +72,20 @@ jobs:
GOWORK: 'off'
run: go build -trimpath -o wasmforge-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }} ./cmd/wasmforge
- name: Build darwin universal binary (arm64 + amd64 via lipo)
if: matrix.goos == 'darwin' && matrix.goarch == 'universal'
env:
CGO_ENABLED: '1'
GOWORK: 'off'
run: |
GOOS=darwin GOARCH=arm64 \
go build -trimpath -o wasmforge-darwin-arm64 ./cmd/wasmforge
GOOS=darwin GOARCH=amd64 CC="clang -arch x86_64" CXX="clang++ -arch x86_64" \
go build -trimpath -o wasmforge-darwin-amd64 ./cmd/wasmforge
lipo -create -output wasmforge-darwin-universal \
wasmforge-darwin-arm64 wasmforge-darwin-amd64
lipo -info wasmforge-darwin-universal
- uses: actions/upload-artifact@v4
with:
name: wasmforge-${{ matrix.goos }}-${{ matrix.goarch }}