File tree Expand file tree Collapse file tree 3 files changed +38
-38
lines changed Expand file tree Collapse file tree 3 files changed +38
-38
lines changed Original file line number Diff line number Diff line change @@ -24,29 +24,10 @@ jobs:
24
24
uses : actions/checkout@v2
25
25
26
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()
27
+ uses : goreleaser/goreleaser-action@v2
43
28
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 }}
29
+ version : latest
30
+ args : release --rm-dist
50
31
env :
51
32
GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
52
33
Original file line number Diff line number Diff line change 1
1
# !/usr/bin/make
2
2
3
3
.DEFAULT_GOAL := all
4
- PLATFORMS := linux/amd64 darwin/amd64 windows/amd64
5
-
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
-
8
- temp = $(subst /, ,$@ )
9
- os = $(word 1, $(temp ) )
10
- arch = $(word 2, $(temp ) )
11
4
12
5
.PHONY : setup
13
6
setup :
14
7
@go install github.com/securego/gosec/v2/cmd/
[email protected]
15
8
@go install github.com/golangci/golangci-lint/cmd/
[email protected]
16
9
17
- GOFILES =$(shell find . -type f -name '* .go' -not -path "./.git/* ")
18
-
19
10
.PHONY : lint
20
11
lint :
21
12
golangci-lint run
26
17
27
18
.PHONY : bin
28
19
bin :
29
- go build -o ./dist/asl
30
-
31
- .PHONY : releases
32
- releases : $(PLATFORMS )
33
-
34
- $(PLATFORMS ) :
35
- GOOS=$(os ) GOARCH=$(arch ) go build $(LD_FLAGS ) -o ' dist/asl_$(os)-$(arch)'
20
+ @go build -o ./dist/asl
36
21
37
22
.PHONY : test
38
23
test :
Original file line number Diff line number Diff line change
1
+ project_name : asl
2
+ env :
3
+ - GO111MODULE=on
4
+ - GOPROXY=https://proxy.golang.org
5
+ before :
6
+ hooks :
7
+ - go mod download
8
+ builds :
9
+ -
10
+ binary : asl
11
+ id : asl
12
+ ldflags : " -X main.Version={{.Version}} -X main.BuildDate={{.Date}} -X main.GitHash={{.Commit}}"
13
+ env :
14
+ - CGO_ENABLED=0
15
+ flags :
16
+ - -buildmode
17
+ - exe
18
+ goos :
19
+ - darwin
20
+ - linux
21
+ goarch :
22
+ - amd64
23
+ - arm64
24
+ goarm :
25
+ - 7
26
+ archives :
27
+ -
28
+ id : asl
29
+ format : binary
30
+ name_template : " {{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
31
+ replacements :
32
+ darwin : Darwin
33
+ linux : Linux
34
+ amd64 : x86_64
You can’t perform that action at this time.
0 commit comments