-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (73 loc) · 1.99 KB
/
test-release.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
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Test & Release
on:
push:
branches:
- master
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Run Golang ci Action
uses: golangci/golangci-lint-action@v3
test:
name: Test
needs: lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Set up cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run Unit tests
run: make test
release:
needs: [lint, test]
runs-on: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
version: ${{ steps.semantic.outputs.release-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Set up cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Tag
uses: codfish/[email protected]
id: semantic
with:
branches: "master"
tag_format: "v${version}"
additional_packages: |
['@semantic-release/commit-analyzer']
plugins: |
['@semantic-release/commit-analyzer']
- name: Go List
if: steps.semantic.outputs.new-release-published == 'true'
run: GOPROXY=proxy.golang.org go list -m github.com/pokt-foundation/utils-go@v${{ steps.semantic.outputs.release-version }}