56 lines
1.2 KiB
YAML
56 lines
1.2 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- goos: linux
|
|
goarch: amd64
|
|
- goos: linux
|
|
goarch: arm64
|
|
- goos: linux
|
|
goarch: arm
|
|
goarm: '7'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.22'
|
|
|
|
- name: Download dependencies
|
|
run: go mod download
|
|
|
|
- name: Vet
|
|
run: go vet ./...
|
|
|
|
- name: Build
|
|
env:
|
|
CGO_ENABLED: '0'
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
GOARM: ${{ matrix.goarm }}
|
|
run: |
|
|
out="bleh-${GOOS}-${GOARCH}${GOARM:+v$GOARM}"
|
|
go build -trimpath -ldflags='-s -w' -o "$out" .
|
|
echo "ARTIFACT=$out" >> "$GITHUB_ENV"
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ env.ARTIFACT }}
|
|
path: ${{ env.ARTIFACT }}
|
|
if-no-files-found: error
|