-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.goreleaser.yml
56 lines (56 loc) · 1.37 KB
/
.goreleaser.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
archives:
- format: tar.gz
name_template: >-
{{- .ProjectName }}_v
{{- .Version }}_
{{- if eq .Os "darwin" }}macos
{{- else }}{{ .Os }}{{ end }}-
{{- if eq .Arch "amd64" }}amd64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end -}}
format_overrides:
- goos: windows
format: zip
files:
- README.md
- LICENSE
- '{{ .ProjectName }}_v{{ .Version }}_SHA256SUM.txt'
before:
hooks:
- go mod tidy
builds:
- binary: '{{ .ProjectName }}_v{{ .Version }}'
env:
- CGO_ENABLED=0
main: './src/cmd/{{ .ProjectName }}/main.go'
flags:
- -trimpath
ldflags:
- '-s -w -X github.com/manhtukhang/{{ .ProjectName }}.Version=v{{ .Version }}'
goos:
- darwin
- linux
- freebsd
- windows
goarch:
- amd64
- arm64
mod_timestamp: '{{ .CommitTimestamp }}'
hooks:
post: |-
sh -c "
cd dist/{{ .ProjectName }}_{{ .Target }} &&\
sha256sum {{ .ProjectName }}_v{{ .Version }}* > ../../{{ .ProjectName }}_v{{ .Version }}_SHA256SUM.txt
"
sboms:
- id: spdx
artifacts: archive
checksum:
algorithm: sha256
name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS.txt'
changelog:
use: github-native
release:
draft: true
replace_existing_draft: true