-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yaml
140 lines (122 loc) · 4.94 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# GoReleaser configuration.
# Documentation: https://goreleaser.com
project_name: labrador
before:
hooks:
# Ensure that the go.mod file matches the source code in the module.
- go mod tidy
# Execute generate directives in files: "//go:generate ..."
- go generate ./...
builds:
- env:
# Do not include the host libc.
- CGO_ENABLED=0
goos:
- linux
# - windows
# - darwin
goarch:
- amd64
# - arm64
# - i386
# - arm
ldflags:
# -s disable symbol table
- '-s'
# -w disable DWARF generation
- '-w'
# -X set module variables at build time
- '-X github.com/divergentcodes/labrador/internal/core.Version={{.Version}}'
- '-X github.com/divergentcodes/labrador/internal/core.Commit={{.Commit}}'
- '-X github.com/divergentcodes/labrador/internal/core.Date={{.Date}}'
- '-X github.com/divergentcodes/labrador/internal/core.BuiltBy=goreleaser'
# Snapshots are one-off builds that can be ad hoc.
# "git pull" fetches tags (used in versions) by default.
snapshot:
name_template: "{{ incpatch .Version }}-DEV-SNAPSHOT-{{.ShortCommit}}"
checksum:
name_template: 'checksums.txt'
# Changelog generation follows Conventional Commits.
# https://www.conventionalcommits.org/en
changelog:
# Set this to true if you don't want any changelog at all.
# skip: '{{ .Env.SKIP_CHANGELOG }}'
# Changelog generation implementation to use.
# - `git`: uses `git log`;
# - `github`: uses the compare GitHub API, appending the author login to the changelog.
# - `gitlab`: uses the compare GitLab API, appending the author name and email to the changelog.
# - `github-native`: uses the GitHub release notes generation API, disables the groups feature.
use: github
# Sorts the changelog by the commit's messages.
# Could either be asc, desc or empty
# Default is empty
sort: asc
# Max commit hash length to use in the changelog.
#
# 0: use whatever the changelog implementation gives you
# -1: remove the commit hash from the changelog
# any other number: max length.
#
# Default: 0.
abbrev: 0
# Group commits messages by given regex and title.
# Order value defines the order of the groups.
# Providing no regex means all commits will be grouped under the default group.
# Groups are disabled when using github-native, as it already groups things by itself.
# Matches are performed against strings of the form: "<abbrev-commit>[:] <title-commit>".
# Regex use RE2 syntax as defined here: https://github.com/google/re2/wiki/Syntax.
#
# Default is no groups.
groups:
- title: Features
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 0
- title: 'Bug fixes'
regexp: '^.*?bug(\([[:word:]]+\))??!?:.+$'
order: 1
- title: Others
order: 999
# Exclude commit messages matching the listed regexp from the changelog.
filters:
exclude:
- '^ignore:'
- '^docs:'
- '^test:'
- typo
- refactor
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
dockers:
- image_templates:
# Snapshot only image tags.
- "{{ if .IsSnapshot }}ghcr.io/divergentcodes/{{ .ProjectName }}:dev-snapshot{{ end }}"
- "{{ if .IsSnapshot }}ghcr.io/divergentcodes/{{ .ProjectName }}:{{ incpatch .Version }}-dev-snapshot-{{.ShortCommit}}{{ end }}"
# Pre-release and stable image tags.
- "{{ if not .IsSnapshot }}ghcr.io/divergentcodes/{{ .ProjectName }}:v{{ .Version }}{{ end }}"
- "{{ if not .IsSnapshot }}ghcr.io/divergentcodes/{{ .ProjectName }}:{{ .Tag }}{{ end }}"
# Stable only release image tags.
- "{{ if not .IsSnapshot }}{{ if not .Prerelease }}ghcr.io/divergentcodes/{{ .ProjectName }}:latest{{ end }}{{ end }}"
- "{{ if not .IsSnapshot }}{{ if not .Prerelease }}ghcr.io/divergentcodes/{{ .ProjectName }}:v{{ .Major }}{{ end }}{{ end }}"
- "{{ if not .IsSnapshot }}{{ if not .Prerelease }}ghcr.io/divergentcodes/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}{{ end }}{{ end }}"
build_flag_templates:
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.description=Pull secrets from remote services into CI/CD pipelines."
# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj