forked from parca-dev/parca-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yml
123 lines (120 loc) · 4.08 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
# 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
dist: ./goreleaser/dist
before:
hooks:
- go mod tidy
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 ARCH=amd64 libbpf
- ./scripts/download-async-profiler.sh
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=amd64
- -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=arm64
- -extldflags=-static
tags:
- osusergo
- netgo
archives:
# e.g. parca_agent_0.15.0_Linux_aarch64.tar.gz, parca_agent_0.15.0_Linux_x86_64.tar.gz
- name_template: >-
{{ .ProjectName }}_
{{- trimprefix .Version "v" }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "arm64" }}aarch64
{{- else }}{{ .Arch }}{{ end }}
format_overrides:
- goos: windows
format: zip
files:
- 'LICENSE*'
- 'README*'
- src: goreleaser/dist/async-profiler/LICENSE
dst: async-profiler
strip_parent: true
- src: goreleaser/dist/async-profiler/x64/libc/*
dst: async-profiler/x64/libc
strip_parent: true
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Tag }}-{{ .ShortCommit }}"
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:'