File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : go-releaser
2+
3+ permissions :
4+ contents : write
5+ id-token : write
6+ packages : write
7+
8+ on :
9+ push :
10+ tags : [ 'v*' ]
11+
12+ jobs :
13+ goreleaser :
14+ runs-on : ubuntu-latest
15+ env :
16+ flags : ' '
17+ steps :
18+ - name : Checkout
19+ uses : actions/checkout@v3
20+ - name : Set up Go
21+ uses : actions/setup-go@v3
22+ with :
23+ go-version : 1.21
24+ cache : true
25+ - name : Run GoReleaser
26+ uses : goreleaser/goreleaser-action@v5
27+ with :
28+ distribution : goreleaser
29+ version : latest
30+ args : release --clean ${{ env.flags }}
31+ env :
32+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ project_name : GoMonitor
2+
3+ before :
4+ hooks :
5+ - go mod tidy
6+
7+ builds :
8+ - binary : GoMonitor
9+ main : .
10+ env :
11+ - CGO_ENABLED=0
12+ goos :
13+ - linux
14+ goarch :
15+ - ' 386'
16+ - amd64
17+ - arm
18+ - arm64
19+ goarm :
20+ - ' 6'
21+ - ' 7'
22+ ignore :
23+ - goos : linux
24+ goarch : arm
25+ goarm : ' 7'
26+
27+ checksum :
28+ name_template : " checksums.txt"
29+
30+ archives :
31+ - name_template : >-
32+ {{ .ProjectName }}_
33+ {{- .Version }}_
34+ {{- if eq .Os "darwin" }}macos_
35+ {{- else }}{{ .Os }}_{{ end }}
36+ {{- if eq .Arch "amd64" }}x86_64
37+ {{- else if eq .Arch "386" }}i386
38+ {{- else if eq .Arch "arm64" }}aarch64
39+ {{- else if eq .Arch "arm" }}armv{{ .Arm }}
40+ {{- else }}{{ .Arch }}{{ end }}
41+ wrap_in_directory: true
42+ format_overrides:
43+ - goos: windows
44+ format: zip
45+ builds_info:
46+ group: root
47+ owner: root
48+ files:
49+ - README.md
50+ - LICENSE
51+
52+
53+
54+
Original file line number Diff line number Diff line change 66
77``` shell
88go mod tidy
9- bo build
9+ go build
1010```
1111
1212## 命令使用
You can’t perform that action at this time.
0 commit comments