-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (60 loc) · 1.54 KB
/
go.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Go
on:
push:
branches: [ main ]
tags: [ 'v*.*.*' ]
paths-ignore:
- 'docs/**'
pull_request:
branches: [ main ]
paths-ignore:
- 'docs/**'
jobs:
test-build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@main
- name: Set up Go
uses: actions/setup-go@main
with:
go-version: 1.17
- name: Vet
run: go vet ./...
- name: Build
run: go build -ldflags="-s -w" -o build/entrypoint-node . && ls -lh build/entrypoint-node
- name: Test
run: go test -v -race ./... -coverprofile=build/coverage.out
- name: Upload test coverage
uses: actions/upload-artifact@main
with:
name: build
path: build
if: github.ref_name == 'main'
publish-binary:
needs: test-build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@main
with:
go-version: 1.17
- name: Fetch all tags
run: git fetch --force --tags
if: startsWith(github.ref_name, 'v')
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@master
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
if: startsWith(github.ref_name, 'v')
publish-docker:
needs: test-build
uses: ./.github/workflows/docker-publish.yml