Skip to content

v0.0.1 RC 3

v0.0.1 RC 3 #3

Workflow file for this run

name: Build & Release Go
on:
release:
types: [published]
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.x'
check-latest: true
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: go mod tidy
- name: Run Go test
run: go test ./... -v
- name: Build binaries
run: |
mkdir -p dist
GOOS=linux GOARCH=amd64 go build -o dist/${{ github.event.repository.name }}-linux-amd64
GOOS=linux GOARCH=arm64 go build -o dist/${{ github.event.repository.name }}-linux-arm64
GOOS=darwin GOARCH=amd64 go build -o dist/${{ github.event.repository.name }}-darwin-amd64
GOOS=windows GOARCH=amd64 go build -o dist/${{ github.event.repository.name }}-windows-amd64.exe
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: go-binaries
path: dist/*
release:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: go-binaries
path: dist
- name: Attach binaries to release
uses: softprops/action-gh-release@v2
with:
files: dist/*
tag_name: ${{ github.event.release.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}