Skip to content

Commit

Permalink
Cleanup release workflow actions.
Browse files Browse the repository at this point in the history
- Fix golint version
- Use the new linter and checkout actions now configured in the linter
  job.
- v3 of golint removed the go-setup dependency: golangci/golangci-lint-action#403

Signed-off-by: Brendan Winter <bwinter@vmware.com>
  • Loading branch information
bwinter committed Jun 2, 2023
1 parent e24afd4 commit 063f8db
Showing 1 changed file with 37 additions and 19 deletions.
56 changes: 37 additions & 19 deletions .github/workflows/release.yml
Expand Up @@ -2,39 +2,57 @@ name: Release

on:
push:
tags:
- 'v*'
tags: [ v* ]
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
# Permission for checking out code
contents: read

jobs:
unit:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.18.x", "1.19.x", "1.20.x"]
steps:
- uses: actions/checkout@v3
- run: go test -timeout=120s -v -race -short

goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.17
-
name: golangci-lint
uses: golangci/golangci-lint-action@v2
go-version: 1.18
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
skip-pkg-cache: true
skip-build-cache: true
# Required: the version of golangci-lint is required and must be specified without a patch version:
# we always use the latest patch version.
version: v1.52
# Optional: if set to `true` then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
skip-cache: true
args: --issues-exit-code=1
-
name: Import GPG key
- name: Run gofmt
run: diff -u <(echo -n) <(gofmt -d .)
- name: Run go vet
run: go vet ./
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v2
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
Expand Down

0 comments on commit 063f8db

Please sign in to comment.