-
Notifications
You must be signed in to change notification settings - Fork 15
/
.goreleaser.yaml
162 lines (152 loc) · 5.34 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
release:
# If set to auto, will mark the release as not ready for production
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
# If set to true, will mark the release as not ready for production.
prerelease: auto
builds:
- binary: anchore-k8s-inventory
id: generic
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
goarch:
- amd64
- arm64
# Set the modified timestamp on the output binary to the git timestamp (to ensure a reproducible build)
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags: |
-w
-s
-extldflags '-static'
-X github.com/anchore/k8s-inventory/internal/version.version={{.Version}}
-X github.com/anchore/k8s-inventory/internal/version.gitCommit={{.Commit}}
-X github.com/anchore/k8s-inventory/internal/version.buildDate={{.Date}}
-X github.com/anchore/k8s-inventory/internal/version.gitTreeState={{.Env.BUILD_GIT_TREE_STATE}}
- binary: anchore-k8s-inventory
id: fips
env:
- CGO_ENABLED=1
- GOEXPERIMENT=boringcrypto
goos:
- linux
goarch:
- amd64
# Set the modified timestamp on the output binary to the git timestamp (to ensure a reproducible build)
mod_timestamp: '{{ .CommitTimestamp }}'
ldflags: |
-w
-linkmode=external
-extldflags '-static'
-X github.com/anchore/k8s-inventory/internal/version.version={{.Version}}
-X github.com/anchore/k8s-inventory/internal/version.gitCommit={{.Commit}}
-X github.com/anchore/k8s-inventory/internal/version.buildDate={{.Date}}
-X github.com/anchore/k8s-inventory/internal/version.gitTreeState={{.Env.BUILD_GIT_TREE_STATE}}
archives:
- id: archive-generic
format: tar.gz
builds:
- generic
name_template: 'anchore-k8s-inventory_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
- id: archive-fips
format: tar.gz
builds:
- fips
name_template: 'anchore-k8s-inventory-fips_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
dockers:
- image_templates:
- "anchore/k8s-inventory:latest"
- "anchore/k8s-inventory:v{{ .Major }}-amd64"
- "anchore/k8s-inventory:v{{ .Major }}.{{ .Minor }}-amd64"
dockerfile: Dockerfile
use: buildx
ids:
- generic
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=BUILD_DATE={{.Date}}"
- "--build-arg=BUILD_VERSION={{.Version}}"
- "--build-arg=VCS_REF={{.FullCommit}}"
- "--build-arg=VCS_URL={{.GitURL}}"
skip_push: auto
- image_templates:
- "anchore/k8s-inventory:{{ .Tag }}-amd64"
dockerfile: Dockerfile
use: buildx
ids:
- generic
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=BUILD_DATE={{.Date}}"
- "--build-arg=BUILD_VERSION={{.Version}}"
- "--build-arg=VCS_REF={{.FullCommit}}"
- "--build-arg=VCS_URL={{.GitURL}}"
- image_templates:
- "anchore/k8s-inventory:v{{ .Major }}-arm64v8"
- "anchore/k8s-inventory:v{{ .Major }}.{{ .Minor }}-arm64v8"
goarch: arm64
dockerfile: Dockerfile
use: buildx
ids:
- generic
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--build-arg=BUILD_DATE={{.Date}}"
- "--build-arg=BUILD_VERSION={{.Version}}"
- "--build-arg=VCS_REF={{.FullCommit}}"
- "--build-arg=VCS_URL={{.GitURL}}"
skip_push: auto
- image_templates:
- "anchore/k8s-inventory:{{ .Tag }}-arm64v8"
goarch: arm64
dockerfile: Dockerfile
use: buildx
ids:
- generic
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--build-arg=BUILD_DATE={{.Date}}"
- "--build-arg=BUILD_VERSION={{.Version}}"
- "--build-arg=VCS_REF={{.FullCommit}}"
- "--build-arg=VCS_URL={{.GitURL}}"
- image_templates:
- "anchore/k8s-inventory:{{ .Tag }}-fips-amd64"
dockerfile: Dockerfile
use: buildx
ids:
- fips
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=BUILD_DATE={{.Date}}"
- "--build-arg=BUILD_VERSION={{.Version}}"
- "--build-arg=VCS_REF={{.FullCommit}}"
- "--build-arg=VCS_URL={{.GitURL}}"
skip_push: auto
docker_manifests:
- name_template: anchore/k8s-inventory:{{ .Tag }}
image_templates:
- anchore/k8s-inventory:{{ .Tag }}-amd64
- anchore/k8s-inventory:{{ .Tag }}-fips-amd64
- anchore/k8s-inventory:v{{ .Major }}-amd64
- anchore/k8s-inventory:v{{ .Major }}.{{ .Minor }}-amd64
- anchore/k8s-inventory:{{ .Tag }}-arm64v8
- anchore/k8s-inventory:v{{ .Major }}-arm64v8
- anchore/k8s-inventory:v{{ .Major }}.{{ .Minor }}-arm64v8
skip_push: auto
- name_template: anchore/k8s-inventory:latest
image_templates:
- anchore/k8s-inventory:{{ .Tag }}-amd64
- anchore/k8s-inventory:{{ .Tag }}-fips-amd64
- anchore/k8s-inventory:v{{ .Major }}-amd64
- anchore/k8s-inventory:v{{ .Major }}.{{ .Minor }}-amd64
- anchore/k8s-inventory:{{ .Tag }}-arm64v8
- anchore/k8s-inventory:v{{ .Major }}-arm64v8
- anchore/k8s-inventory:v{{ .Major }}.{{ .Minor }}-arm64v8
skip_push: auto