termtap/.github/workflows/release.yml
2026-04-26 22:12:47 -07:00

70 lines
1.7 KiB
YAML

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: macos-latest
goos: darwin
goarch: amd64
- os: macos-latest
goos: darwin
goarch: arm64
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
- os: ubuntu-latest
goos: linux
goarch: 386
- os: windows-latest
goos: windows
goarch: amd64
- os: windows-latest
goos: windows
goarch: arm64
- os: windows-latest
goos: windows
goarch: 386
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.26"
- name: Test
shell: bash
run: go test ./...
- name: Build
shell: bash
run: |
mkdir -p dist
binary="dist/termtap-${{ matrix.goos }}-${{ matrix.goarch }}"
if [ "${{ matrix.goos }}" = "windows" ]; then
binary="${binary}.exe"
fi
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o "$binary" ./cmd/tap/main.go
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: termtap-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: dist
- uses: softprops/action-gh-release@v2
with:
files: dist/**/*