-
Notifications
You must be signed in to change notification settings - Fork 8
/
.goreleaser.yaml
199 lines (187 loc) · 6.66 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
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
---
project_name: sbom-convert
version: 2
before:
hooks:
- go mod tidy
- ./scripts/completions.sh {{ .ProjectName }}
- ./scripts/manpages.sh {{ .ProjectName }}
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm
- arm64
goarm:
- "7"
ignore:
- goos: windows
goarch: arm
flags:
- -trimpath
ldflags:
- -s -w -X {{ .ModulePath }}/cmd/cli.version={{.Version}} -X {{ .ModulePath }}/cmd/cli.name={{.ProjectName}}
main: .
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
# TODO: improve section: ref: https://github.com/goreleaser/goreleaser/blob/main/.goreleaser.yaml
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "merge conflict"
- Merge pull request
- Merge remote-tracking branch
- Merge branch
- go mod tidy
release:
disable: false
name_template: "v{{ .Version }}"
github:
owner: "{{ .Env.ORG_NAME }}"
name: "{{ .ProjectName }}"
nfpms:
- file_name_template: "{{ .ConventionalFileName }}"
id: packages
homepage: https://github.com/{{ .Env.ORG_NAME }}/{{ .ProjectName }}
description: |-
A tool to convert between different Software Bill of Materials (SBOM) formats.
maintainer: Ori Avraham <[email protected]>
vendor: "{{ .Env.ORG_NAME }}"
bindir: /usr/bin
section: utils
contents:
- src: ./completions/{{ .ProjectName }}.bash
dst: /usr/share/bash-completion/completions/{{ .ProjectName }}
file_info:
mode: 0644
- src: ./completions/{{ .ProjectName }}.fish
dst: /usr/share/fish/vendor_completions.d/{{ .ProjectName }}.fish
file_info:
mode: 0644
- src: ./completions/{{ .ProjectName }}.zsh
dst: /usr/share/zsh/vendor-completions/_{{ .ProjectName }}
file_info:
mode: 0644
- src: ./manpages/{{ .ProjectName }}.1.gz
dst: /usr/share/man/man1/{{ .ProjectName }}.1.gz
file_info:
mode: 0644
- src: ./LICENSE
dst: /usr/share/doc/{{ .ProjectName }}/copyright
file_info:
mode: 0644
formats:
- apk
- deb
- rpm
- archlinux
dependencies:
- git
deb:
lintian_overrides:
- statically-linked-binary
- changelog-file-missing-in-native-package
archives:
# NOTE: consider mapping x86_64 to amd64
- name_template: >-
{{ .ProjectName }}_
{{- title .Os | tolower }}_
{{- if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip
builds_info:
group: root
owner: root
files:
- README.md
- LICENSE
- completions/*
- manpages/*
publishers:
- name: fury.io
ids:
- packages
env:
- "FURY_TOKEN={{ .Env.FURY_TOKEN }}"
- "FURY_ORG={{ .Env.ORG_NAME }}"
cmd: ./scripts/fury-upload.sh {{ .ArtifactName }}
scoops:
- repository:
owner: "{{ .Env.ORG_NAME }}"
name: scoop-bucket
homepage: https://github.com/{{ .Env.ORG_NAME }}/{{ .ProjectName }}
description: A tool to convert between different Software Bill of Materials (SBOM) formats.
license: Apache-2.0
brews:
- repository:
owner: "{{ .Env.ORG_NAME }}"
name: homebrew-tap
homepage: https://github.com/{{ .Env.ORG_NAME }}/{{ .ProjectName }}
goarm: "7"
description: A tool to convert between different Software Bill of Materials (SBOM) formats.
license: Apache-2.0
directory: Formula
install: |-
bin.install "{{ .ProjectName }}"
bash_completion.install "completions/{{ .ProjectName }}.bash" => "{{ .ProjectName }}"
zsh_completion.install "completions/{{ .ProjectName }}.zsh" => "_{{ .ProjectName }}"
fish_completion.install "completions/{{ .ProjectName }}.fish"
man1.install "manpages/{{ .ProjectName }}.1.gz"
dockers:
- image_templates:
- "ghcr.io/{{ .Env.ORG_NAME }}/{{ .ProjectName }}:{{ .Tag }}-amd64"
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/{{ .Env.ORG_NAME }}/{{ .ProjectName }}/main/README.md"
- "--label=io.artifacthub.package.logo-url=https://todo.add/file.png"
- '--label=io.artifacthub.package.maintainers=[{"name":"Ori Avraham","email":"[email protected]"}]'
- "--label=io.artifacthub.package.license=Apache-2.0"
- "--label=org.opencontainers.image.description=A tool to convert between different Software Bill of Materials (SBOM) formats."
- "--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=https://github.com/{{ .Env.ORG_NAME }}/{{ .ProjectName }}"
- "--platform=linux/amd64"
- image_templates:
- "ghcr.io/{{ .Env.ORG_NAME }}/{{ .ProjectName }}:{{ .Tag }}-arm64"
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/{{ .Env.ORG_NAME }}/{{ .ProjectName }}/main/README.md"
- "--label=io.artifacthub.package.logo-url=https://todo.add/file.png"
- '--label=io.artifacthub.package.maintainers=[{"name":"Ori Avraham","email":"[email protected]"}]'
- "--label=io.artifacthub.package.license=Apache-2.0"
- "--label=org.opencontainers.image.description=A tool to convert between different Software Bill of Materials (SBOM) formats."
- "--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=https://github.com/{{ .Env.ORG_NAME }}/{{ .ProjectName }}"
- "--platform=linux/arm64"
goarch: arm64
docker_manifests:
- name_template: "ghcr.io/{{ .Env.ORG_NAME }}/{{ .ProjectName }}:{{ .Tag }}"
image_templates:
- "ghcr.io/{{ .Env.ORG_NAME }}/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "ghcr.io/{{ .Env.ORG_NAME }}/{{ .ProjectName }}:{{ .Tag }}-arm64"
- name_template: "ghcr.io/{{ .Env.ORG_NAME }}/{{ .ProjectName }}:latest"
image_templates:
- "ghcr.io/{{ .Env.ORG_NAME }}/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "ghcr.io/{{ .Env.ORG_NAME }}/{{ .ProjectName }}:{{ .Tag }}-arm64"