fix(release): use direct Go build instead of build action (#272)

The build action only supports wails2/cpp stacks and defaults to wails2
for unknown projects. Core is a pure Go CLI with no frontend, so it
needs direct go build.

Changes:
- Replace host-uk/build@dev with direct go build steps
- Build separate darwin/amd64 and darwin/arm64 (no universal binary)
- Set CGO_ENABLED=0 for static binaries
- Inject version via -ldflags

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Snider 2026-02-03 04:51:04 +00:00 committed by GitHub
parent 06ff6ab4a5
commit 5f696fd252

View file

@ -14,25 +14,51 @@ jobs:
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
platform: linux/amd64 goos: linux
goarch: amd64
ext: ""
- os: ubuntu-latest - os: ubuntu-latest
platform: linux/arm64 goos: linux
goarch: arm64
ext: ""
- os: macos-latest - os: macos-latest
platform: darwin/universal goos: darwin
goarch: amd64
ext: ""
- os: macos-latest
goos: darwin
goarch: arm64
ext: ""
- os: windows-latest - os: windows-latest
platform: windows/amd64 goos: windows
goarch: amd64
ext: ".exe"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Build - name: Setup Go
uses: host-uk/build@dev uses: actions/setup-go@v5
with: with:
build-name: core go-version: '1.23'
build-platform: ${{ matrix.platform }} cache: true
build: true
package: true - name: Build CLI
sign: false env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: |
mkdir -p dist
go build -ldflags="-s -w -X main.Version=${{ github.ref_name }}" \
-o dist/core-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.ext }} \
./cmd/core
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: core-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/core-*
release: release:
needs: build needs: build