Skip to content

Update goreleaser/goreleaser-action action to v5 #35

Update goreleaser/goreleaser-action action to v5

Update goreleaser/goreleaser-action action to v5 #35

Workflow file for this run

name: build
on:
push:
branches:
- 'main'
- 'workflow-test'
tags:
- 'v*'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.18
-
name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Tests
run: |
go mod tidy
go test -v ./...
-
name: Docker Login
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
if: success() && startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}