File tree Expand file tree Collapse file tree 3 files changed +92
-1
lines changed Expand file tree Collapse file tree 3 files changed +92
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Build
2
+
3
+ on :
4
+ - push
5
+ - pull_request
6
+
7
+ jobs :
8
+ test-build :
9
+ name : Test & Build
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Set up Go 1.16
14
+ uses : actions/setup-go@v2
15
+ with :
16
+ go-version : ' 1.16.2'
17
+
18
+ - name : Set GOPATH and PATH
19
+ run : |
20
+ echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
21
+ echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH
22
+ shell : bash
23
+
24
+ - name : Check out code
25
+ uses : actions/checkout@v2
26
+
27
+ - name : Update build dependencies
28
+ run : make setup
29
+
30
+ - name : Check quality code
31
+ run : make verify
32
+
33
+ - name : Test
34
+ run : make test
35
+
36
+ - name : Build
37
+ run : make bin
38
+
Original file line number Diff line number Diff line change
1
+ name : Release
2
+ on :
3
+ push :
4
+ tags :
5
+ - ' v*'
6
+ jobs :
7
+ build :
8
+ name : Create Release
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - name : Set up Go 1.16
13
+ uses : actions/setup-go@v2
14
+ with :
15
+ go-version : ' 1.16.2'
16
+
17
+ - name : Set GOPATH and PATH
18
+ run : |
19
+ echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV
20
+ echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH
21
+ shell : bash
22
+
23
+ - name : Check out code into the Go module directory
24
+ uses : actions/checkout@v2
25
+
26
+ - name : Generate releases
27
+ run : make releases
28
+
29
+ - name : Create Release
30
+ id : create_release
31
+ uses : actions/create-release@v1
32
+ env :
33
+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
34
+ with :
35
+ tag_name : ${{ github.ref }}
36
+ release_name : ${{ github.ref }}
37
+ draft : false
38
+ prerelease : false
39
+
40
+ - name : GitHub Release
41
+ uses : softprops/action-gh-release@v1
42
+ if : success()
43
+ with :
44
+ draft : true
45
+ files : |
46
+ dist/asl_darwin-amd64
47
+ dist/asl_linux-amd64
48
+ dist/asl_windows-amd64
49
+ name : ${{ github.ref }}
50
+ env :
51
+ GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
52
+
Original file line number Diff line number Diff line change 3
3
.DEFAULT_GOAL := all
4
4
PLATFORMS := linux/amd64 darwin/amd64 windows/amd64
5
5
6
- LD_FLAGS := -ldflags "-X main.Version=` git describe ` -X main.BuildDate=` date -u +%Y-%m-%d_%H:%M:%S ` -X main.GitHash=` git rev-parse HEAD ` "
6
+ LD_FLAGS := -ldflags "-X main.Version=` git describe --tags ` -X main.BuildDate=` date -u +%Y-%m-%d_%H:%M:%S ` -X main.GitHash=` git rev-parse HEAD ` "
7
7
8
8
temp = $(subst /, ,$@ )
9
9
os = $(word 1, $(temp ) )
14
14
@go get golang.org/x/lint/
[email protected]
15
15
@go get golang.org/x/tools/cmd/
[email protected]
16
16
@go get github.com/securego/gosec/
[email protected]
17
+ @go mod download
17
18
18
19
GOFILES =$(shell find . -type f -name '* .go' -not -path "./.git/* ")
19
20
You can’t perform that action at this time.
0 commit comments