-
Notifications
You must be signed in to change notification settings - Fork 738
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
247 lines (240 loc) · 8.58 KB
/
.goreleaser.yaml
File metadata and controls
247 lines (240 loc) · 8.58 KB
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
project_name: pyroscope
version: 2
before:
hooks:
# This hook ensures that goreleaser uses the correct go version for a Pyroscope release
- sh -euc 'go version | grep "go version go1.25.9 " || { echo "Unexpected go version"; exit 1; }'
env:
# Strip debug information from the binary by default, weekly builds will have debug information
- GORELEASER_DEBUG_INFO_FLAGS={{ if and (index .Env "GORELEASER_STRIP_DEBUG_INFO") (eq .Env.GORELEASER_STRIP_DEBUG_INFO "false") }}{{ else }}-s -w{{ end }}
# Use a custom image prefix (registry) or fallback to docker.io/grafana/
- IMAGE_PREFIX={{ or (index .Env "IMAGE_PREFIX") "docker.io/grafana/" }}
# Allow a custom image tag to be used (must be set by workflow)
- IMAGE_TAG={{ .Env.IMAGE_TAG }}
# Publish latest image tag
- IMAGE_PUBLISH_LATEST={{ or (index .Env "IMAGE_PUBLISH_LATEST") "false" }}
# Skip GitHub release upload
- GITHUB_RELEASE_DISABLE={{ or (index .Env "GITHUB_RELEASE_DISABLE") "false" }}
# Skip builds of non linux oses
- GORELEASER_LINUX_ONLY={{ or (index .Env "GORELEASER_LINUX_ONLY") "false" }}
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
goamd64:
- v2
main: ./cmd/pyroscope
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
tags:
- netgo
- embedassets
ldflags:
- >
-extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Branch={{ .Branch }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Version={{ .Version }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Revision={{ .ShortCommit }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.BuildDate={{ .CommitDate }}"
id: pyroscope
- env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- amd64
- arm64
goamd64:
- v2
main: ./cmd/pyroscope
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
tags:
- netgo
- embedassets
ldflags:
- >
-extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Branch={{ .Branch }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Version={{ .Version }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Revision={{ .ShortCommit }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.BuildDate={{ .CommitDate }}"
id: pyroscope_non_linux
skip: '{{ if eq .Env.GORELEASER_LINUX_ONLY "true" }}true{{ else }}false{{ end }}'
- env:
- CGO_ENABLED=0
tags:
- netgo
ldflags:
- >
-extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Branch={{ .Branch }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Version={{ .Version }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Revision={{ .ShortCommit }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.BuildDate={{ .CommitDate }}"
goos:
- linux
goarch:
- amd64
- arm64
goamd64:
- v2
ignore:
- goos: windows
goarch: arm
main: ./cmd/profilecli
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
binary: profilecli
id: profilecli
- env:
- CGO_ENABLED=0
tags:
- netgo
ldflags:
- >
-extldflags "-static" {{ .Env.GORELEASER_DEBUG_INFO_FLAGS }}
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Branch={{ .Branch }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Version={{ .Version }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.Revision={{ .ShortCommit }}"
-X "github.com/grafana/pyroscope/v2/pkg/util/build.BuildDate={{ .CommitDate }}"
goos:
- windows
- darwin
goarch:
- amd64
- arm64
goamd64:
- v2
ignore:
- goos: windows
goarch: arm
main: ./cmd/profilecli
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
binary: profilecli
id: profilecli_non_linux
skip: '{{ if eq .Env.GORELEASER_LINUX_ONLY "true" }}true{{ else }}false{{ end }}'
dockers:
- use: buildx
goos: linux
goarch: amd64
goamd64: v2
dockerfile: ./cmd/pyroscope/Dockerfile
ids:
- pyroscope
- profilecli
extra_files:
- cmd/pyroscope/pyroscope.yaml
image_templates:
- "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64"
build_flag_templates:
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- use: buildx
goos: linux
goarch: arm64
dockerfile: ./cmd/pyroscope/Dockerfile
ids:
- pyroscope
- profilecli
extra_files:
- cmd/pyroscope/pyroscope.yaml
image_templates:
- "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64v8"
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
docker_manifests:
# https://goreleaser.com/customization/docker_manifest/
- name_template: "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}"
image_templates:
- "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64"
- "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64v8"
- name_template: "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:latest"
image_templates:
- "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-amd64"
- "{{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}-arm64v8"
skip_push: '{{ if eq .Env.IMAGE_PUBLISH_LATEST "true" }}false{{ else }}true{{ end }}'
nfpms:
- id: pyroscope
formats:
- deb
- rpm
section: default
maintainer: Grafana Labs <support@grafana.com>
vendor: Grafana Labs Inc
homepage: https://grafana.com/pyroscope
license: AGPL-3.0
file_name_template: '{{ .PackageName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v2") }}{{ .Amd64 }}{{ end }}'
contents:
- src: ./tools/packaging/pyroscope.service
dst: /etc/systemd/system/pyroscope.service
- src: ./cmd/pyroscope/pyroscope.yaml
dst: /etc/pyroscope/config.yml
type: config|noreplace
scripts:
postinstall: ./tools/packaging/postinstall.sh
archives:
- id: pyroscope
name_template: '{{.ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v2") }}{{ .Amd64 }}{{ end }}'
ids:
- pyroscope
- pyroscope_non_linux
- id: profilecli
name_template: 'profilecli_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v2") }}{{ .Amd64 }}{{ end }}'
ids:
- profilecli
- profilecli_non_linux
format_overrides:
- goos: windows
formats: [zip]
checksum:
name_template: "checksums.txt"
snapshot:
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- "^test:"
release:
# Draft releases break our Homebrew release which
# depends on asset urls created on release "publish"
draft: false
make_latest: '{{ .Env.IMAGE_PUBLISH_LATEST }}'
footer: |
As always, feedback is more than welcome, feel free to open issues/discussions.
You can reach out to the team using:
- [Slack](https://grafana.slack.com/archives/C049PLMV8TB)
- [Github Discussions](https://github.com/grafana/pyroscope/discussions)
- [Github Issues](https://github.com/grafana/pyroscope/issues)
- [Mailing List](https://groups.google.com/g/pyroscope-team)
## Docker Images
- [grafana/pyroscope](https://hub.docker.com/r/grafana/pyroscope/tags)
```bash
docker pull {{ .Env.IMAGE_PREFIX }}{{ .ProjectName }}:{{ .Env.IMAGE_TAG }}
```
ids:
- pyroscope
- profilecli
disable: '{{ .Env.GITHUB_RELEASE_DISABLE }}'
# milestones:
# - close: true
# modelines, 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