File tree Expand file tree Collapse file tree 1 file changed +33
-2
lines changed
Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Original file line number Diff line number Diff line change 1- name : unit- tests
1+ name : tests-and-release
22
33on :
44 pull_request :
55 workflow_dispatch :
66 push :
77 branches :
88 - main
9+ tags :
10+ - " *"
11+
12+ permissions :
13+ contents : write
14+
15+ env :
16+ GO_VERSION : " 1.22"
917
1018jobs :
1119 unit-test :
1725 - name : set up go
1826 uses : actions/setup-go@v5
1927 with :
20- go-version : " 1.22 "
28+ go-version : ${{ env.GO_VERSION}}
2129
2230 - name : unit tests
2331 run : go test ./...
32+
33+ release :
34+ runs-on : ubuntu-latest
35+ needs : unit-test
36+ if : startsWith(github.ref, 'refs/tags/')
37+ steps :
38+ - name : checkout
39+ uses : actions/checkout@v4
40+ with :
41+ fetch-depth : 0
42+
43+ - name : set up go
44+ uses : actions/setup-go@v5
45+ with :
46+ go-version : ${{ env.GO_VERSION}}
47+
48+ - name : create release
49+ uses : goreleaser/goreleaser-action@master
50+ with :
51+ version : latest
52+ args : release --clean
53+ env :
54+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments