backtrace/.github/workflows/main.yaml
2024-05-01 08:48:31 +00:00

105 lines
2.4 KiB
YAML

name: Build and Release
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [published]
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 'stable'
- name: Build and Test on Default Platform
run: |
cd ${{ github.workspace }}
go build -v ./...
go test -v ./...
release-binary:
name: Release Go Binary
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
goos: [windows, freebsd, openbsd, linux, darwin]
goarch: [amd64, 386]
exclude:
- goarch: 386
goos: darwin
include:
- goos: darwin
goarch: arm64
- goos: linux
goarch: arm
goarm: 7
- goos: linux
goarch: arm
goarm: 6
- goos: linux
goarch: arm
goarm: 5
- goos: android
goarch: arm64
- goos: windows
goarch: arm64
- goos: windows
goarch: arm
goarm: 7
- goos: linux
goarch: arm64
- goos: linux
goarch: riscv64
- goos: linux
goarch: mips64
- goos: linux
goarch: mips64le
- goos: linux
goarch: mipsle
- goos: linux
goarch: mips
- goos: linux
goarch: mipsle
gomips: softfloat
- goos: linux
goarch: mips
gomips: softfloat
- goos: linux
goarch: ppc64
- goos: linux
goarch: ppc64le
- goos: freebsd
goarch: arm64
- goos: freebsd
goarch: arm
goarm: 7
- goos: openbsd
goarch: arm64
- goos: openbsd
goarch: arm
goarm: 7
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
GOMIPS: ${{ matrix.gomips }}
CGO_ENABLED: 0
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Release Go Binary
run: |
cd ${{ github.workspace }}
go build -o backtrace-${{ matrix.goos }}-${{ matrix.goarch }} -v ./...