-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yml
80 lines (80 loc) · 2.32 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Make sure to check the documentation at https://goreleaser.com
before:
hooks:
- go mod tidy
gomod:
# Proxy a module from proxy.golang.org, making the builds verifiable.
# This will only be effective if running against a tag. Snapshots will ignore
# this setting.
# Notice: for this to work your `build.main` must be a package, not a `.go` file.
proxy: true
# If proxy is true, use these environment variables when running `go mod`
# commands (namely, `go mod tidy`).
#
# Default: `os.Environ()` merged with what you set the root `env` section.
env:
- GOPROXY=https://proxy.golang.org,direct
- GOSUMDB=sum.golang.org
# Sets the `-mod` flag value.
#
# Since: v1.7
mod: mod
# Build for all first-class targets
builds:
- main: ./cmd/example
binary: example
env: ["CGO_ENABLED=0"]
goos: ["linux", "windows", "darwin"]
flags: ["-trimpath"]
ldflags: ["-s -w"]
targets: ["go_first_class"]
mod_timestamp: '{{ .CommitTimestamp }}'
# Non-Linux OS like Windows prefer a file extension
checksum:
name_template: 'checksums.txt'
# Split formats for different OS requirements
archives:
- format: tar.gz
# This name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# Use zip for Windows archives
format_overrides:
- goos: windows
format: zip
# Also bundle sources
source:
enabled: true
# Creates SBOMs of all archives and the source tarball using syft
# https://goreleaser.com/customization/sbom
sboms:
- artifacts: archive
- id: source # Two different sbom configurations need two different IDs
artifacts: source
# Name snapshot version 'next'
snapshot:
name_template: "{{ incpatch .Version }}-next"
# Generate changelog from conventional commits
changelog:
sort: asc
filters:
exclude:
- '^chore:'
- '^test:'
groups:
- title: 'New Features'
regexp: "^.*feat[(\\w)]*:+.*$"
order: 100
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 200
- title: "Documentation updates"
regexp: "^.*docs[(\\w)]*:+.*$"
order: 400
- title: 'Other work'
order: 999