-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (45 loc) · 1.18 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: main
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: actions/checkout@v3
- name: Build
run: go build ./...
- name: Test
run: go test -v ./...
- name: Install Tools
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
go install honnef.co/go/tools/cmd/staticcheck@latest
go install golang.org/x/lint/golint@latest
go install mvdan.cc/gofumpt@latest
- name: Lint
run: |
staticcheck ./...
golint ./...
go vet ./...
test -z "$( gofumpt -extra -l ./ )"
release:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.20'
- uses: actions/checkout@v3
- uses: goreleaser/goreleaser-action@v4
name: Run GoReleaser
with:
distribution: goreleaser
version: latest
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}