-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yaml
106 lines (105 loc) · 2.92 KB
/
.goreleaser.yaml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
version: 2
before:
hooks:
# Run all pre-checks before goreleaser cuts a release.
- make goreleaser_verify
builds:
- env:
- GO111MODULE=on
# Disable CGO (i.e. binary will be statically linked).
- CGO_ENABLED=0
flags:
# Trim the path for reproducible builds.
- -trimpath
ldflags:
# Strip debugging symbols.
- -s -w
# Include version and commit information (uses commit date for
# reproducible builds).
- -X main.pkgVersion={{.Version}}
- -X main.pkgCommit={{.ShortCommit}}
- -X main.pkgTimestamp={{.CommitDate}}
# Use the commit timestamp as the binary's modified timestamp.
mod_timestamp: '{{ .CommitTimestamp }}'
# Set to true only for library projects.
skip: true
# Target platform and architectures.
targets:
- linux_amd64
- linux_386
- linux_arm64
- linux_arm_6
- linux_arm_7
- darwin_amd64
- darwin_arm64
- windows_amd64
- windows_386
- windows_arm64
- windows_arm_6
- windows_arm_7
archives:
# Package in tar.xz format except for Windows (uses .zip instead).
- format: tar.xz
name_template: >-
{{- .ProjectName }}_
{{- .Version }}_
{{- if eq .Os "darwin" }}macOS{{ else }}{{ title .Os }}{{ end }}_
{{- if eq .Arch "amd64" }}x86_64{{ else if eq .Arch "386" }}i386{{ else }}{{ .Arch }}{{ end }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}
format_overrides:
- goos: windows
format: zip
universal_binaries:
# Build a universal fat binary for macOS (i.e. build a single binary
# which contains the binaries for all architectures under macOS) packaged
# into a single archive, and delete the other single architecture macOS
# archives.
- replace: true
source:
enabled: true
name_template: "{{ .ProjectName }}-v{{ .Version }}-src"
format: tar.gz
checksum:
# Checksum configuration.
name_template: 'checksums.txt'
algorithm: sha256
signs:
- signature: "${artifact}.sig"
cmd: gpg
args:
- "-u"
- "8D458AC08D2CE9CE"
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
artifacts: all
gomod:
# Load dependencies using proxy.golang.org to create a verifiable build.
proxy: true
env:
- GOPROXY=https://proxy.golang.org,direct
- GOSUMDB=sum.golang.org
gobinary: go
snapshot:
# Custom naming for snapshot builds.
version_template: "{{ incpatch .Version }}-dev-{{ .ShortCommit }}"
changelog:
use: github
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
release:
draft: false
discussion_category_name: Releases
prerelease: auto
mode: keep-existing
header: |
## Released {{ time "Mon, Jan 2 2006 03:04 PM UTC-0700" }}
{{ .TagSubject }}
{{ .TagBody }}
footer: |
## Thanks!
Those include all the new changes in the {{ .Tag }} release!
name_template: "{{.ProjectName}} v{{.Version}}"