-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (51 loc) · 1.47 KB
/
build.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
on:
push:
tags:
- '*'
branches:
- master
pull_request:
types:
- opened
- synchronize
permissions:
contents: write
jobs:
tests:
name: CI Tests & Release
runs-on: ubuntu-latest
environment: CI
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1.19'
- name: Install Dependencies
run: |
go install github.com/mattn/goveralls@latest
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1
- name: Build & Test
run: |
make build
go test -v -covermode=count -coverprofile=coverage.out ./...
$(go env GOPATH)/bin/golangci-lint run ./...
- name: Goveralls
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out
- name: Release Prep
run: |
git checkout -- go.mod go.sum
docker login -u=atomicptr -p="$DOCKER_ACCESS_TOKEN"
env:
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Release
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
if: ${{ startsWith(github.ref, 'refs/tags/v') }}