update to goreleaser v2 #1093
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: lint-golang | |
on: | |
push: | |
branches: [dev] | |
paths: | |
- 'src/go/**' | |
- '.github/workflows/lint-golang.yml' | |
tags-ignore: | |
- '**' | |
pull_request: | |
paths: | |
- 'src/go/**' | |
- '.github/workflows/lint-golang.yml' | |
jobs: | |
lint-go-files: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache-dependency-path: src/go/rpk/go.mod | |
- uses: golangci/golangci-lint-action@v6 | |
with: | |
version: latest | |
args: --timeout 10m --verbose | |
working-directory: src/go/rpk/ | |
- name: Install gofumpt | |
env: | |
GOFUMPT_VER: 0.5.0 | |
run: | | |
mkdir -v -p "$HOME/.local/bin" | |
wget -O "$HOME/.local/bin/gofumpt" "https://github.com/mvdan/gofumpt/releases/download/v${GOFUMPT_VER}/gofumpt_v${GOFUMPT_VER}_linux_amd64" | |
chmod 0700 "$HOME/.local/bin/gofumpt" | |
- name: Run gofumpt | |
run: | | |
find src/go -type f -not -name '*.connect.go' -not -name '*.pb.go' -not -name 'zz*' -name '*.go' | xargs -n1 "$HOME/.local/bin/gofumpt" -w -lang=1.20 | |
git diff --exit-code | |
- name: Run go mod tidy (rpk) | |
working-directory: src/go/rpk | |
run: | | |
go mod tidy | |
git diff --exit-code -- go.mod go.sum | |
- name: Check goreleaser configuration file | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
args: check src/go/.goreleaser.yaml |