-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.goreleaser.yaml
219 lines (208 loc) · 6.59 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
project_name: grpc-starter-kit
env:
- CGO_ENABLED=0
# - GOWORK=off
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...
# setup builds for linux and darwin on amd64 and arm64
# https://goreleaser.com/customization/build
builds:
- id: account-cli
binary: account-cli
goos: [ linux, darwin, windows ]
goarch: [ amd64, arm64 ]
main: ./cmd/account/
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser
- id: account
binary: app
goos: [ linux ]
goarch: [ amd64, arm64 ]
main: ./service/account/
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser
- id: emailer
binary: app
goos: [ linux ]
goarch: [ amd64, arm64 ]
main: ./service/emailer/
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser
# Verifiable Builds
# https://goreleaser.com/customization/verifiable_builds/
# FIXME: this is not working yet
#gomod:
# proxy: true
# env:
# - GOPROXY=https://proxy.golang.org,direct
# - GOSUMDB=sum.golang.org
# - GOPRIVATE=go.buf.build
# config the binaries archives
# https://goreleaser.com/customization/archive/
archives:
- builds: [account-cli]
allow_different_binary_count: true
replacements:
darwin: MacOS
linux: Linux
windows: Windows
386: i386
amd64: x86_64
files: # Additional files
- config/certs/*.pem
# customize release notes
# https://goreleaser.com/customization/release/
release:
header: |
Welcome to this new release!
footer: |
## Docker Images
- docker pull `ghcr.io/xmlking/grpc-starter-kit/account:latest`
- docker pull `ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}`
- docker pull `ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}-amd64`
- docker pull `ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}-arm64`
# customize how the changelog is generated
# https://goreleaser.com/customization/changelog/
changelog:
sort: asc
use: github
filters:
exclude:
- '^docs:'
- '^test:'
- '^ci:'
- '^draft'
- '^wip'
- 'merge conflict'
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy
groups:
- title: 'New Features and updates'
regexp: "^.*feat[(\\w)]*:+.*$"
order: 100
- title: 'Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 200
- title: 'Documentation'
regexp: "^.*docs[(\\w)]*:+.*$"
order: 300
- title: 'Dependency updates'
regexp: "^.*chore\\(deps\\)*:+.*$"
order: 400
- title: Others
order: 999
# create a source tarball
# https://goreleaser.com/customization/source/
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
# signs the checksum file
# all files (including the sboms) are included in the checksum, so we don't need to sign each one if we don't want to
# https://goreleaser.com/customization/sign
# Example keyless signing with SBOMs goreleaser config.
# See also: .github/workflows/release.yml
signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
certificate: '${artifact}.pem'
args:
- sign-blob
- '--output-certificate=${certificate}'
- '--output-signature=${signature}'
- '${artifact}'
artifacts: checksum
output: true
# create multi-arch docker images
# https://goreleaser.com/customization/docker
# TODO: https://goreleaser.com/customization/ko/
dockers:
- id: account-amd64
use: buildx
goarch: amd64
dockerfile: Dockerfile
image_templates:
- 'ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}-amd64'
extra_files:
- config
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.description=Account Service linux-amd64"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- '--label=org.opencontainers.image.source={{ trimsuffix .GitURL ".git" }}'
- "--platform=linux/amd64"
- id: account-arm64
use: buildx
goarch: arm64
dockerfile: Dockerfile
image_templates:
- 'ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}-arm64'
extra_files:
- config
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.description=Account Service linux-arm64"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- '--label=org.opencontainers.image.source={{ trimsuffix .GitURL ".git" }}'
- "--platform=linux/arm64"
docker_manifests:
- name_template: 'ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}'
image_templates:
- 'ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}-amd64'
- 'ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}-arm64'
- name_template: 'ghcr.io/xmlking/grpc-starter-kit/account:latest'
image_templates:
- 'ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}-amd64'
- 'ghcr.io/xmlking/grpc-starter-kit/account:{{ .Tag }}-arm64'
# signs our docker image
# https://goreleaser.com/customization/docker_sign
docker_signs:
- cmd: cosign
env:
- COSIGN_EXPERIMENTAL=1
artifacts: images
output: true
args:
- 'sign'
- '${artifact}'
#brews:
# - tap:
# owner: xmlking
# name: homebrew-tap
# folder: Formula
# homepage: https://github.com/xmlking/grpc-starter-kit
# description: tz is a policy management tool
# test: |
# system "#{bin}/tz version"
announce:
slack:
enabled: true
channel: '#release'