mirror of
https://github.com/praetorian-inc/wasmforge
synced 2026-06-22 22:52:31 +00:00
541b4f001c
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.
106 lines
2.8 KiB
YAML
106 lines
2.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
generate-assets:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25.3'
|
|
cache-dependency-path: go.sum
|
|
|
|
- name: Generate build assets
|
|
env:
|
|
GOWORK: 'off'
|
|
run: go run ./cmd/gen-build-assets
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-assets
|
|
path: internal/build/build_assets.tar.gz
|
|
|
|
build:
|
|
needs: generate-assets
|
|
runs-on: ${{ matrix.runs-on }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- goos: linux
|
|
goarch: amd64
|
|
ext: ''
|
|
runs-on: ubuntu-latest
|
|
- goos: windows
|
|
goarch: amd64
|
|
ext: .exe
|
|
runs-on: windows-latest
|
|
- goos: darwin
|
|
goarch: universal
|
|
ext: ''
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25.3'
|
|
cache-dependency-path: go.sum
|
|
|
|
- name: Download build assets
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: build-assets
|
|
path: internal/build
|
|
|
|
- name: Build (single arch)
|
|
if: matrix.goarch != 'universal'
|
|
env:
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
CGO_ENABLED: '1'
|
|
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 }}
|
|
path: wasmforge-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }}
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
merge-multiple: true
|
|
- uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
wasmforge-*
|
|
generate_release_notes: true
|