From 541b4f001cb031a7ed66d2ae7a06070677971337 Mon Sep 17 00:00:00 2001 From: michaelweber <39742080+michaelweber@users.noreply.github.com> Date: Tue, 16 Jun 2026 15:42:19 -0400 Subject: [PATCH] ci(release): replace darwin/amd64 matrix entry with darwin/universal lipo build (#2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/release.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57ab98d..4e55d54 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }}