-
Notifications
You must be signed in to change notification settings - Fork 5
/
.goreleaser.yml
283 lines (263 loc) · 7.88 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
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# SPDX-FileCopyrightText: 2023 Siemens AG
#
# SPDX-License-Identifier: Apache-2.0
#
# Author: Michael Adler <michael.adler@siemens.com>
---
project_name: wfx
version: 2
before:
hooks:
- go mod download
builds:
- id: wfx
binary: wfx
main: ./cmd/wfx
tags:
- sqlite
- postgres
- mysql
- plugin
- swagger
flags:
- -trimpath
- -mod=readonly
ldflags:
- -s -w -linkmode external -extldflags '-static'
- -X github.com/siemens/wfx/cmd/wfx/metadata.Version={{.Version}}
- -X github.com/siemens/wfx/cmd/wfx/metadata.Commit={{.Commit}}
- -X github.com/siemens/wfx/cmd/wfx/metadata.Date={{.CommitDate}}
env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
- arm64
mod_timestamp: "{{ .CommitTimestamp }}"
hooks:
post:
- |
{{ if and (eq .Os "linux") (eq .Arch "amd64") -}}
.ci/goreleaser/hook.sh '{{ .Path }}'
{{ else -}}
true
{{ end }}
- id: wfxctl
binary: wfxctl
main: ./cmd/wfxctl
flags:
- -trimpath
- -mod=readonly
ldflags:
- -s -w -linkmode external -extldflags '-static'
- -X github.com/siemens/wfx/cmd/wfxctl/metadata.Version={{.Version}}
- -X github.com/siemens/wfx/cmd/wfxctl/metadata.Commit={{.Commit}}
- -X github.com/siemens/wfx/cmd/wfxctl/metadata.Date={{.CommitDate}}
env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
- arm64
mod_timestamp: "{{ .CommitTimestamp }}"
hooks:
post:
- |
{{ if and (eq .Os "linux") (eq .Arch "amd64") -}}
.ci/goreleaser/hook.sh '{{ .Path }}'
{{ else -}}
true
{{ end }}
- id: wfx-viewer
binary: wfx-viewer
main: ./cmd/wfx-viewer
flags:
- -trimpath
- -mod=readonly
ldflags:
- -s -w -linkmode external -extldflags '-static'
- -X github.com/siemens/wfx/cmd/wfx-viewer/metadata.Version={{.Version}}
- -X github.com/siemens/wfx/cmd/wfx-viewer/metadata.Commit={{.Commit}}
- -X github.com/siemens/wfx/cmd/wfx-viewer/metadata.Date={{.CommitDate}}
env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
- arm64
mod_timestamp: "{{ .CommitTimestamp }}"
hooks:
post:
- |
{{ if and (eq .Os "linux") (eq .Arch "amd64") -}}
.ci/goreleaser/hook.sh '{{ .Path }}'
{{ else -}}
true
{{ end }}
archives:
- id: wfx
builds:
- wfx
name_template: >-
{{.Binary}}-{{.Version}}-{{.Os}}-{{- if eq .Arch "amd64" }}x86_64{{ else }}{{.Arch}}{{ end }}{{ if .Arm }}v{{.Arm }}{{ end }}
format: tar.zst
files:
- LICENSE
- README.md
- CHANGELOG.md
- docs/*.md
- id: wfxctl
builds:
- wfxctl
name_template: >-
{{.Binary}}-{{.Version}}-{{.Os}}-{{- if eq .Arch "amd64" }}x86_64{{ else }}{{.Arch}}{{ end }}{{ if .Arm }}v{{.Arm }}{{ end }}
format: tar.zst
files:
- LICENSE
- id: wfx-viewer
builds:
- wfx-viewer
name_template: >-
{{.Binary}}-{{.Version}}-{{.Os}}-{{- if eq .Arch "amd64" }}x86_64{{ else }}{{.Arch}}{{ end }}{{ if .Arm }}v{{.Arm }}{{ end }}
format: tar.zst
files:
- LICENSE
nfpms:
- id: wfx
package_name: wfx
file_name_template: '{{ .PackageName }}_{{ .Version }}_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{ else }}{{.Arch}}{{ end }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
builds:
- wfx
vendor: Siemens AG
homepage: https://github.com/siemens/wfx
maintainer: Michael Adler <michael.adler@siemens.com>
description: a lightweight, general-purpose workflow executor
license: Apache-2.0
formats:
- deb
- rpm
bindir: /usr/bin
section: net
priority: extra
scripts:
postinstall: .ci/goreleaser/postinstall.sh
postremove: .ci/goreleaser/postremove.sh
contents:
# it's the same content for all architectures
- src: dist/wfx_linux_amd64_v1/wfx.bash
dst: /usr/share/bash-completion/completions/wfx
- src: dist/wfx_linux_amd64_v1/_wfx
dst: /usr/share/zsh/vendor-completions/_wfx
- src: dist/wfx_linux_amd64_v1/wfx.fish
dst: /usr/share/fish/completions/wfx.fish
- src: dist/wfx_linux_amd64_v1/*.1.gz
dst: /usr/share/man/man1/
- src: share/systemd/wfx.service
dst: /lib/systemd/system/wfx.service
- src: share/systemd/wfx@.socket
dst: /lib/systemd/system/wfx@.socket
- src: share/systemd/wfx@.service
dst: /lib/systemd/system/wfx@.service
recommends:
- bash-completion
- id: wfxctl
package_name: wfxctl
file_name_template: '{{ .PackageName }}_{{ .Version }}_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{ else }}{{.Arch}}{{ end }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
builds:
- wfxctl
vendor: Siemens AG
homepage: https://github.com/siemens/wfx
maintainer: Michael Adler <michael.adler@siemens.com>
description: wfx client
license: Apache-2.0
formats:
- deb
bindir: /usr/bin
section: net
priority: extra
contents:
# it's the same content for all architectures
- src: dist/wfxctl_linux_amd64_v1/wfxctl.bash
dst: /usr/share/bash-completion/completions/wfxctl
- src: dist/wfxctl_linux_amd64_v1/_wfxctl
dst: /usr/share/zsh/vendor-completions/_wfxctl
- src: dist/wfxctl_linux_amd64_v1/wfxctl.fish
dst: /usr/share/fish/completions/wfxctl.fish
- src: dist/wfxctl_linux_amd64_v1/*.1.gz
dst: /usr/share/man/man1/
recommends:
- bash-completion
- id: wfx-viewer
package_name: wfx-viewer
file_name_template: '{{ .PackageName }}_{{ .Version }}_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{ else }}{{.Arch}}{{ end }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
builds:
- wfx-viewer
vendor: Siemens AG
homepage: https://github.com/siemens/wfx
maintainer: Michael Adler <michael.adler@siemens.com>
description: |-
Workflow Executor viewer.
license: Apache-2.0
formats:
- deb
bindir: /usr/bin
section: utils
priority: extra
contents:
# it's the same content for all architectures
- src: dist/wfx-viewer_linux_amd64_v1/wfx-viewer.bash
dst: /usr/share/bash-completion/completions/wfx-viewer
- src: dist/wfx-viewer_linux_amd64_v1/_wfx-viewer
dst: /usr/share/zsh/vendor-completions/_wfx-viewer
- src: dist/wfx-viewer_linux_amd64_v1/wfx-viewer.fish
dst: /usr/share/fish/completions/wfx-viewer.fish
- src: dist/wfx-viewer_linux_amd64_v1/*.1.gz
dst: /usr/share/man/man1/
dockers:
- id: wfx
ids:
- wfx
image_templates:
- "ghcr.io/siemens/wfx:latest"
- "ghcr.io/siemens/wfx:{{ .Tag }}"
build_flag_templates:
- "--pull"
checksum:
name_template: "{{.ProjectName}}_{{.Version}}_SHA256SUMS"
algorithm: sha256
snapshot:
version_template: "{{ .Tag }}-next"
release:
draft: true
replace_existing_draft: true
changelog:
sort: asc
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: "Bug fixes"
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: Others
order: 999
filters:
exclude:
- "^docs:"
- "^test:"
sboms:
- id: spdx
artifacts: binary
cmd: syft
args: ["$artifact", "--output", "spdx-json=$document"]
documents:
- "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.spdx.sbom.json"
- id: cyclonedx
artifacts: binary
cmd: syft
args: ["$artifact", "--output", "cyclonedx-json=$document"]
documents:
- "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.cyclonedx.sbom.json"