Bump goreleaser/goreleaser-action from 5 to 6 #337
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Build & Test | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
name: Build & Test | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Build & Test | |
run: | | |
go build -v | |
go test ./... | |
# It only runs on Linux because the goreleaser command is executed on Linux. | |
- name: Run GoReleaser | |
if: runner.os == 'Linux' | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
args: release --clean --snapshot --skip-publish | |
# Output tests | |
- name: Normal Output Test | |
run: go run main.go -- main.go | |
# ref. https://github.com/gfx/example-github-actions-with-tty | |
- name: Colored Output Test | |
if: runner.os == 'Linux' | |
shell: 'script -q -e -c "bash {0}"' | |
run: go run main.go -- main.go |