forked from parca-dev/parca-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yml
131 lines (128 loc) · 4.2 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
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
# NOTICE: This file is written with the assumption that it will be used in parca-dev/cross-builder.
# - There are paths in this file that are specific to parca-dev/cross-builder and Github Actions.
# - Unfortunately, Goreleaser does not support templating environment variables per build config.
project_name: parca-agent
before:
hooks:
- go mod tidy -compat=1.17
env:
- CGO_ENABLED=1
- LDFLAGS=-fuse-ld=lld
- PKG_CONFIG=pkg-config
- CMD_CC=clang
- CC=clang
builds:
# NOTICE: This build config assumes that the build runs on a x86_64 host.
- main: ./cmd/parca-agent/
id: "parca-agent-amd64"
binary: parca-agent
# https://goreleaser.com/customization/build/#reproducible-builds
mod_timestamp: '{{ .CommitTimestamp }}'
env:
# Needed by CGO.
- CGO_CFLAGS=-target x86_64-pc-linux-gnu -I/__w/parca-agent/parca-agent/dist/libbpf/amd64/usr/include
- CGO_LDFLAGS=-target x86_64-pc-linux-gnu -lelf -lz /__w/parca-agent/parca-agent/dist/libbpf/amd64/libbpf.a
# Needed for compiling libbpf (defined in Make).
- CFLAGS=-g -O2 -Werror -Wall -std=gnu89 -target x86_64-pc-linux-gnu
goos:
- linux
goarch:
- amd64
hooks:
pre:
- make libbpf
flags:
- -mod=readonly
- -trimpath
- -v
ldflags:
# https://goreleaser.com/customization/build/#reproducible-builds
# {{.CommitDate}} is the date of the commit to make builds reproducible.
- -X main.version={{.Version}} -X main.commit={{.FullCommit}} -X main.date={{.CommitDate}} -X main.goArch={{.Runtime.Goarch}}
- -extldflags=-static
tags:
- osusergo
- netgo
- main: ./cmd/parca-agent/
id: "parca-agent-arm64"
binary: parca-agent
# https://goreleaser.com/customization/build/#reproducible-builds
mod_timestamp: '{{ .CommitTimestamp }}'
env:
# Needed by CGO.
- PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
- CGO_CFLAGS=-target arm64-pc-linux-gnu --sysroot=/usr/aarch64-linux-gnu -I/__w/parca-agent/parca-agent/dist/libbpf/arm64/usr/include
- CGO_LDFLAGS=-target arm64-pc-linux-gnu -fuse-ld=/usr/aarch64-linux-gnu/bin/ld -lelf -lz /__w/parca-agent/parca-agent/dist/libbpf/arm64/libbpf.a
# Needed for compiling libbpf (defined in Make).
- CFLAGS=-g -O2 -Werror -Wall -std=gnu89 -target arm64-pc-linux-gnu
goos:
- linux
goarch:
- arm64
hooks:
pre:
- make ARCH=arm64 libbpf
flags:
- -mod=readonly
- -trimpath
- -v
ldflags:
# https://goreleaser.com/customization/build/#reproducible-builds
# {{.CommitDate}} is the date of the commit to make builds reproducible.
- -X main.version={{.Version}} -X main.commit={{.FullCommit}} -X main.date={{.CommitDate}} -X main.goArch={{.Runtime.Goarch}}
- -extldflags=-static
tags:
- osusergo
- netgo
- main: ./cmd/debug-info/
id: "debug-info"
binary: parca-debug-info
# https://goreleaser.com/customization/build/#reproducible-builds
mod_timestamp: '{{ .CommitTimestamp }}'
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
flags:
- -trimpath
- -v
ldflags:
# https://goreleaser.com/customization/build/#reproducible-builds
# {{.CommitDate}} is the date of the commit to make builds reproducible.
- -X main.version={{.Version}} -X main.commit={{.FullCommit}} -X main.date={{.CommitDate}} -X main.goArch={{.Runtime.Goarch}}
archives:
- replacements:
linux: Linux
amd64: x86_64
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Tag }}-next"
release:
prerelease: auto
# Defaults to empty.
footer: |
## Docker images
`docker pull ghcr.io/parca-dev/parca-agent:{{ .Tag }}`
## Thanks!
Join our [Discord server](https://discord.com/invite/ZgUpYgpzXy);
Follow us on [Twitter](https://twitter.com/ParcaDev);
Read the [documentation](https://www.parca.dev/docs/overview).
changelog:
sort: asc
use: github
filters:
exclude:
- '^docs:'
- '^test:'
gomod:
proxy: true
env:
- GOPROXY=https://proxy.golang.org,direct
- GOSUMDB=sum.golang.org