File tree Expand file tree Collapse file tree 4 files changed +67
-29
lines changed Expand file tree Collapse file tree 4 files changed +67
-29
lines changed Original file line number Diff line number Diff line change 1+ name : Golang CI
2+
3+ on :
4+ push :
5+ branches : [master]
6+ pull_request :
7+ types : [opened, reopened, synchronize]
8+ schedule :
9+ - cron : ' 15 3 * * 0'
10+
11+ jobs :
12+ build :
13+ name : CI Build
14+ runs-on : ubuntu-latest
15+ steps :
16+ - name : Setup Go
17+ uses : actions/setup-go@v2
18+ with :
19+ go-version : ' 1.15'
20+ - name : Setup tools
21+ run : |
22+ go get golang.org/x/lint/golint
23+ - name : Checkout code
24+ uses : actions/checkout@v2
25+ - name : Test Project
26+ run : |
27+ make test
28+ - name : Build Project
29+ run : |
30+ make
Original file line number Diff line number Diff line change 1+ name : Publish release artifacts
2+
3+ on :
4+ release :
5+ type : [created]
6+
7+ jobs :
8+ release :
9+ name : Publish binaries
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Setup Go
13+ uses : actions/setup-go@v2
14+ with :
15+ go-version : ' 1.15'
16+ - name : Checkout code
17+ uses : actions/checkout@v2
18+ with :
19+ fetch-depth : 0
20+ - name : Build Project binaries
21+ env :
22+ CGO_ENABLED : 0
23+ run : |
24+ make xc
25+ - name : Upload binaries to release
26+ uses : svenstaro/upload-release-action@v2
27+ with :
28+ repo_token : ${{ secrets.GITHUB_TOKEN }}
29+ file : dist/aws*
30+ tag : ${{ github.ref }}
31+ overwrite : true
32+ file_glob : true
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ GOPKGS=$(shell go list ./...)
2525
2626OUTPUT_FILE =$(NAME ) -$(BUILD_VERSION ) -$(shell go env GOOS) -$(shell go env GOARCH)$(shell go env GOARM)$(shell go env GOEXE)
2727OUTPUT_LINK =$(NAME )$(shell go env GOEXE)
28+ WINDOWS_ZIP =$(shell echo $(OUTPUT_FILE ) | sed 's/\.exe/\.zip/')
2829
2930default : build
3031
@@ -69,7 +70,11 @@ build: go_generate _build
6970 $(foreach TARGET,$(TARGETS ) ,ln -sf $(OUTPUT_FILE ) dist/$(OUTPUT_LINK ) ;)
7071
7172compress : _build
73+ ifeq ($(GOOS ) ,windows)
74+ zip -j dist/$(WINDOWS_ZIP) dist/$(OUTPUT_FILE)
75+ else
7276 tar czf dist/$(OUTPUT_FILE).tar.gz -C dist $(OUTPUT_FILE)
77+ endif
7378 rm -f dist/$(OUTPUT_FILE)
7479
7580xc : go_generate
You can’t perform that action at this time.
0 commit comments