File tree Expand file tree Collapse file tree 2 files changed +54
-8
lines changed Expand file tree Collapse file tree 2 files changed +54
-8
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,16 @@ name: Go
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ tags :
6
+ - v*
7
+ branches :
8
+ - main
6
9
pull_request :
7
- branches : [ main ]
10
+ branches :
11
+ - main
12
+
13
+ permissions :
14
+ contents : write
8
15
9
16
jobs :
10
17
@@ -13,14 +20,14 @@ jobs:
13
20
runs-on : ubuntu-latest
14
21
steps :
15
22
23
+ - name : Check out code into the Go module directory
24
+ uses : actions/checkout@v2
25
+
16
26
- name : Set up Go 1.x
17
27
uses : actions/setup-go@v2
18
28
with :
19
29
go-version : ^1.18
20
30
21
- - name : Check out code into the Go module directory
22
- uses : actions/checkout@v2
23
-
24
31
- name : Build
25
32
run : go build -v .
26
33
@@ -29,14 +36,14 @@ jobs:
29
36
runs-on : ubuntu-latest
30
37
steps :
31
38
39
+ - name : Check out code into the Go module directory
40
+ uses : actions/checkout@v2
41
+
32
42
- name : Set up Go 1.x
33
43
uses : actions/setup-go@v2
34
44
with :
35
45
go-version : ^1.18
36
46
37
- - name : Check out code into the Go module directory
38
- uses : actions/checkout@v2
39
-
40
47
- name : Test
41
48
run : go test -v ./...
42
49
49
56
# uses: codecov/codecov-action@v2
50
57
# with:
51
58
# token: ${{ secrets.CODECOV_TOKEN }}
59
+
60
+ release :
61
+ name : Release
62
+ needs : [build, test]
63
+ runs-on : ubuntu-latest
64
+ steps :
65
+
66
+ - name : Check out code into the Go module directory
67
+ uses : actions/checkout@v2
68
+ with :
69
+ fetch-depth : 0
70
+
71
+ - name : Fetch all tags
72
+ run : git fetch --force --tags
73
+
74
+ - name : Set up Go 1.x
75
+ uses : actions/setup-go@v2
76
+ with :
77
+ go-version : ^1.18
78
+
79
+ - name : Run GoReleaser
80
+ uses : goreleaser/goreleaser-action@v2
81
+ if : startsWith(github.ref, 'refs/tags/')
82
+ with :
83
+ version : latest
84
+ args : release --rm-dist
85
+ env :
86
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
1
+ before :
2
+ hooks :
3
+ - go mod tidy
4
+ builds :
5
+ - skip : true
6
+ changelog :
7
+ sort : asc
8
+ filters :
9
+ exclude :
10
+ - ' ^docs:'
11
+ - ' ^test:'
You can’t perform that action at this time.
0 commit comments