ci(workflows): use host-uk/build@dev for releases

- Replace manual Go bootstrap with host-uk/build@dev action
- Add matrix builds for linux/amd64, linux/arm64, darwin/universal, windows/amd64
- Update README URLs from Snider/Core to host-uk/core
- Simplify artifact handling with merge-multiple

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Snider 2026-02-02 17:45:05 +00:00
parent da8178e304
commit e73e3187b0

View file

@ -14,74 +14,31 @@ jobs:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
ext: ""
platform: linux/amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
ext: ""
platform: linux/arm64
- os: macos-latest
goos: darwin
goarch: amd64
ext: ""
- os: macos-latest
goos: darwin
goarch: arm64
ext: ""
platform: darwin/universal
- os: windows-latest
goos: windows
goarch: amd64
ext: ".exe"
platform: windows/amd64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
- name: Build
uses: host-uk/build@v3
with:
go-version: '1.23'
cache: true
- name: Build CLI
shell: bash
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.ext }} \
.
- name: Create archive (Unix)
if: matrix.goos != 'windows'
shell: bash
run: |
cd dist
tar -czvf core-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz core
rm core
- name: Create archive (Windows)
if: matrix.goos == 'windows'
shell: pwsh
run: |
cd dist
Compress-Archive -Path core.exe -DestinationPath core-${{ matrix.goos }}-${{ matrix.goarch }}.zip
Remove-Item core.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: core-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/core-*
build-name: core
build-platform: ${{ matrix.platform }}
build: true
package: true
sign: false
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v7
@ -98,8 +55,9 @@ jobs:
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.ref_name }}
run: |
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
gh release create "$TAG_NAME" \
--title "Release $TAG_NAME" \
--generate-notes \
release/*