-
Notifications
You must be signed in to change notification settings - Fork 27
/
.goreleaser.yml
219 lines (207 loc) · 7.14 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
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
project_name: Chainloop
env:
- CGO_ENABLED=0
- COMMON_LDFLAGS=-s -w
report_sizes: true
builds:
- binary: control-plane
id: control-plane
main: ./app/controlplane/cmd
ldflags:
- "{{ .Env.COMMON_LDFLAGS }}"
- -X github.com/chainloop-dev/chainloop/app/controlplane/internal/server.Version={{ .Version }}
- -X main.Version={{ .Version }}
targets:
- linux_amd64
- binary: artifact-cas
id: artifact-cas
main: ./app/artifact-cas/cmd
ldflags:
- "{{ .Env.COMMON_LDFLAGS }}"
- -X github.com/chainloop-dev/chainloop/app/artifact-cas/internal/server.Version={{ .Version }}
- -X main.Version={{ .Version }}
targets:
- linux_amd64
- binary: chainloop
id: cli
main: ./app/cli
ldflags:
- "{{ .Env.COMMON_LDFLAGS }}"
- -X github.com/chainloop-dev/chainloop/app/cli/cmd.Version={{ .Version }}
targets:
- darwin_amd64
- darwin_arm64
- linux_amd64
- linux_arm64
# Plugins build
# NOTE: On the event of a new plugin added to the project you need to
# 1 - Add the plugins binary to be built in this section
# 2 - Add the plugin ID to the allow-list in the dockers.IDs section
# 3 - Update the Dockerfile.goreleaser
- binary: chainloop-plugin-discord-webhook
id: chainloop-plugin-discord-webhook
main: ./app/controlplane/plugins/core/discord-webhook/v1/cmd
targets:
- linux_amd64
ldflags: ["{{ .Env.COMMON_LDFLAGS }}"]
- binary: chainloop-plugin-smtp
id: chainloop-plugin-smtp
main: ./app/controlplane/plugins/core/smtp/v1/cmd
targets:
- linux_amd64
ldflags: ["{{ .Env.COMMON_LDFLAGS }}"]
- binary: chainloop-plugin-dependency-track
id: chainloop-plugin-dependency-track
main: ./app/controlplane/plugins/core/dependency-track/v1/cmd
targets:
- linux_amd64
archives:
- builds:
- cli
name_template: "chainloop-cli-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
# Override default to not to include the readme nor license file
files:
- none*
checksum:
name_template: "checksums.txt"
signs:
# COSIGN_PASSWORD is also required to be present
- cmd: cosign
args:
[
"sign-blob",
"--key=env://COSIGN_KEY",
"--output-signature=${signature}",
"--yes",
"${artifact}",
]
artifacts: all
docker_signs:
# COSIGN_PASSWORD is also required to be present
- cmd: cosign
args: ["sign", "--key=env://COSIGN_KEY", "--yes", "${artifact}"]
artifacts: all
# Build multiplatform images https://goreleaser.com/cookbooks/multi-platform-docker-images/
dockers:
# control-plane
- dockerfile: app/controlplane/Dockerfile.goreleaser
ids:
- control-plane
- chainloop-plugin-discord-webhook
- chainloop-plugin-smtp
- chainloop-plugin-dependency-track
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-amd64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- dockerfile: app/controlplane/Dockerfile.goreleaser
ids:
- control-plane
- chainloop-plugin-discord-webhook
- chainloop-plugin-smtp
- chainloop-plugin-dependency-track
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-arm64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
# migrations: Container image meant to perform migrations on the database at deployment time
- dockerfile: app/controlplane/Dockerfile.migrations
extra_files:
- app/controlplane/pkg/data/ent/migrate/migrations
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:{{ .Tag }}-amd64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- dockerfile: app/controlplane/Dockerfile.migrations
extra_files:
- app/controlplane/pkg/data/ent/migrate/migrations
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:{{ .Tag }}-arm64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
# cas
- dockerfile: app/artifact-cas/Dockerfile.goreleaser
ids:
- artifact-cas
image_templates:
- "ghcr.io/chainloop-dev/chainloop/artifact-cas:{{ .Tag }}-amd64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- dockerfile: app/artifact-cas/Dockerfile.goreleaser
ids:
- artifact-cas
image_templates:
- "ghcr.io/chainloop-dev/chainloop/artifact-cas:{{ .Tag }}-arm64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
# CLI
- dockerfile: app/cli/Dockerfile.goreleaser
ids:
- cli
image_templates:
- "ghcr.io/chainloop-dev/chainloop/cli:{{ .Tag }}-amd64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- dockerfile: app/cli/Dockerfile.goreleaser
ids:
- cli
image_templates:
- "ghcr.io/chainloop-dev/chainloop/cli:{{ .Tag }}-arm64"
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
docker_manifests:
# control-plane
- name_template: "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}"
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-amd64"
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-arm64"
- name_template: "ghcr.io/chainloop-dev/chainloop/control-plane:latest"
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-amd64"
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-arm64"
# artifact-cas
- name_template: "ghcr.io/chainloop-dev/chainloop/artifact-cas:{{ .Tag }}"
image_templates:
- "ghcr.io/chainloop-dev/chainloop/artifact-cas:{{ .Tag }}-amd64"
- "ghcr.io/chainloop-dev/chainloop/artifact-cas:{{ .Tag }}-arm64"
- name_template: "ghcr.io/chainloop-dev/chainloop/artifact-cas:latest"
image_templates:
- "ghcr.io/chainloop-dev/chainloop/artifact-cas:{{ .Tag }}-amd64"
- "ghcr.io/chainloop-dev/chainloop/artifact-cas:{{ .Tag }}-arm64"
# control-plane-migrations
- name_template: "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:{{ .Tag }}"
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:{{ .Tag }}-amd64"
- "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:{{ .Tag }}-arm64"
- name_template: "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:latest"
image_templates:
- "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:{{ .Tag }}-amd64"
- "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:{{ .Tag }}-arm64"
# cli
- name_template: "ghcr.io/chainloop-dev/chainloop/cli:{{ .Tag }}"
image_templates:
- "ghcr.io/chainloop-dev/chainloop/cli:{{ .Tag }}-amd64"
- "ghcr.io/chainloop-dev/chainloop/cli:{{ .Tag }}-arm64"
- name_template: "ghcr.io/chainloop-dev/chainloop/cli:latest"
image_templates:
- "ghcr.io/chainloop-dev/chainloop/cli:{{ .Tag }}-amd64"
- "ghcr.io/chainloop-dev/chainloop/cli:{{ .Tag }}-arm64"
release:
extra_files:
- glob: ./.github/workflows/cosign.pub