-
Notifications
You must be signed in to change notification settings - Fork 12
/
.goreleaser.yaml
160 lines (147 loc) · 4.68 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
project_name: opentelemetry-collector-releases
builds:
- id: nr-otel-collector
goos:
- linux
- windows
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
dir: distributions/nr-otel-collector/_build
binary: nr-otel-collector
ldflags:
- -s
- -w
flags:
- -trimpath
env:
- CGO_ENABLED=0
archives:
- id: nr-otel-collector
builds:
- nr-otel-collector
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
format_overrides:
- goos: windows
format: zip
nfpms:
- package_name: nr-otel-collector
# Replace arch for rpm from amd64 to x86_64 to be consistent with our rpm repo.
file_name_template: >-
{{ .PackageName }}_{{ .Version }}_{{ .Os }}_
{{- if not (eq (filter .ConventionalFileName "\\.rpm$") "") }}
{{- replace .Arch "amd64" "x86_64" }}
{{- else }}
{{- .Arch }}
{{- end }}
{{- with .Arm }}v{{ . }}{{- end }}
{{- with .Mips }}_{{ . }}{{- end }}
{{- if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{- end }}
contents:
- src: distributions/nr-otel-collector/nr-otel-collector.service
dst: /lib/systemd/system/nr-otel-collector.service
- src: distributions/nr-otel-collector/nr-otel-collector.conf
dst: /etc/nr-otel-collector/nr-otel-collector.conf
type: config|noreplace
- src: configs/nr-otel-collector-agent-linux.yaml
dst: /etc/nr-otel-collector/config.yaml
type: config
scripts:
preinstall: distributions/nr-otel-collector/preinstall.sh
postinstall: distributions/nr-otel-collector/postinstall.sh
preremove: distributions/nr-otel-collector/preremove.sh
id: nr-otel-collector
builds:
- nr-otel-collector
formats:
- deb
- rpm
maintainer: New Relic <[email protected]>
description: OpenTelemetry Collector - nr-otel-collector
license: Apache 2.0
dockers:
- goos: linux
goarch: amd64
dockerfile: distributions/nr-otel-collector/Dockerfile
image_templates:
- newrelic/nr-otel-collector:{{ .Version }}-rc-amd64
extra_files:
- configs/nr-otel-collector-agent-linux.yaml
build_flag_templates:
- --pull
- --platform=linux/amd64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
- goos: linux
goarch: arm64
dockerfile: distributions/nr-otel-collector/Dockerfile
image_templates:
- newrelic/nr-otel-collector:{{ .Version }}-rc-arm64
extra_files:
- configs/nr-otel-collector-agent-linux.yaml
build_flag_templates:
- --pull
- --platform=linux/arm64
- --label=org.opencontainers.image.created={{.Date}}
- --label=org.opencontainers.image.name={{.ProjectName}}
- --label=org.opencontainers.image.revision={{.FullCommit}}
- --label=org.opencontainers.image.version={{.Version}}
- --label=org.opencontainers.image.source={{.GitURL}}
use: buildx
docker_manifests:
- name_template: newrelic/nr-otel-collector:{{ .Version }}-rc
image_templates:
- newrelic/nr-otel-collector:{{ .Version }}-rc-amd64
- newrelic/nr-otel-collector:{{ .Version }}-rc-arm64
signs:
-
id: checksums
# Path to the checksum command.
cmd: ./scripts/generate_checksum.sh
args: [
"-f", "{{ .Env.artifact }}",
]
artifacts: all
-
id: signing
# Path to the signature command.
cmd: ./scripts/signing/sign.sh
args: [
"-f", "{{ .Env.artifact }}",
"-m", "{{ .Env.GPG_MAIL }}",
"-p", "{{ .Env.GPG_PASSPHRASE }}",
"-k", "{{ .Env.GPG_PRIVATE_KEY_BASE64 }}"
]
artifacts: all
publishers:
- name: GH Publisher
cmd: ./scripts/gh_publisher.sh -t {{ .Env.NR_RELEASE_TAG }} -f {{ abs .ArtifactPath }}
extra_files:
- glob: "./dist/*.asc"
- glob: "./dist/*.sum"
env:
- GITHUB_TOKEN={{ .Env.GITHUB_TOKEN }}
git:
# What should be used to sort tags when gathering the current and previous
# tags if there are more than one tag in the same commit.
#
# This is required because of the SemVer tag renaming.
#
# Default: `-version:refname`
tag_sort: -version:creatordate
# Skip creating/updating gh release.
release:
disable: true
# Disable default checksum generator as we use a custom one per each artifact.
checksum:
disable: true
# Skip auto-generating changelog.
changelog:
skip: true