- Fix platform naming: binaries now named core-{os}-{arch} instead of
just 'core', preventing collision when artifacts merge
- Add tar.gz archives for non-Windows builds (Homebrew requirement)
- Add update-tap job to alpha-release workflow that auto-updates
host-uk/homebrew-tap with checksums on each alpha release
- Add homebrew publisher to .core/release.yaml for formal releases
- Update install instructions to include brew install
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
101 lines
2.6 KiB
YAML
101 lines
2.6 KiB
YAML
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push
|
|
name: "Release: Tag Push"
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
goos: linux
|
|
goarch: amd64
|
|
- os: ubuntu-latest
|
|
goos: linux
|
|
goarch: arm64
|
|
- os: macos-latest
|
|
goos: darwin
|
|
goarch: arm64
|
|
- os: windows-latest
|
|
goos: windows
|
|
goarch: amd64
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
# GUI build disabled until build action supports Wails v3
|
|
# - name: Wails Build Action
|
|
# uses: host-uk/build@v4.0.0
|
|
# with:
|
|
# build-name: core
|
|
# build-platform: ${{ matrix.goos }}/${{ matrix.goarch }}
|
|
# build: true
|
|
# package: true
|
|
# sign: false
|
|
|
|
- name: Setup Go
|
|
uses: host-uk/build/actions/setup/go@v4.0.0
|
|
with:
|
|
go-version: "1.25"
|
|
|
|
- name: Build CLI
|
|
shell: bash
|
|
run: |
|
|
EXT=""
|
|
if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi
|
|
BINARY="core${EXT}"
|
|
ARCHIVE_PREFIX="core-${GOOS}-${GOARCH}"
|
|
|
|
go build -ldflags "-s -w" -o "./bin/${BINARY}" .
|
|
|
|
# Create tar.gz for Homebrew (non-Windows)
|
|
if [ "$GOOS" != "windows" ]; then
|
|
tar czf "./bin/${ARCHIVE_PREFIX}.tar.gz" -C ./bin "${BINARY}"
|
|
fi
|
|
|
|
# Rename raw binary to platform-specific name for release
|
|
mv "./bin/${BINARY}" "./bin/${ARCHIVE_PREFIX}${EXT}"
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: core-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
path: ./bin/core-*
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
path: dist
|
|
merge-multiple: true
|
|
|
|
- name: Prepare release files
|
|
run: |
|
|
mkdir -p release
|
|
cp dist/* release/ 2>/dev/null || true
|
|
ls -la release/
|
|
|
|
- name: Create release
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
TAG_NAME: ${{ github.ref_name }}
|
|
run: |
|
|
gh release create "$TAG_NAME" \
|
|
--title "Release $TAG_NAME" \
|
|
--generate-notes \
|
|
release/*
|