forked from labring/sealos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yml
259 lines (248 loc) · 6.75 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
project_name: sealos
#gomod:
# # Proxy a module from proxy.golang.org, making the builds verifiable.
# # This will only be effective if running against a tag. Snapshots will ignore this setting.
# # Notice: for this to work your `build.main` must be a package, not a `.go` file.
# #
# # Default is false.
# proxy: true
#
# # If proxy is true, use these environment variables when running `go mod` commands (namely, `go mod tidy`).
# # Defaults to `os.Environ()`.
# env:
# - GOPROXY=https://goproxy.cn
before:
hooks:
- make clean
- go mod tidy
builds:
- id: sealos
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
main: ./cmd/sealos
binary: sealos
hooks:
post: upx "{{ .Path }}"
goos:
- linux
goarch:
- arm64
- amd64
flags:
- -trimpath
tags:
- containers_image_openpgp
- netgo
- exclude_graphdriver_devicemapper
- static
- osusergo
- exclude_graphdriver_btrfs
ldflags:
- -X github.com/labring/sealos/pkg/version.gitVersion={{.Version}}
- -X github.com/labring/sealos/pkg/version.gitCommit={{.ShortCommit}}
- -X github.com/labring/sealos/pkg/version.buildDate={{.Date}}
- -s -w
overrides:
- goos: linux
goarch: amd64
goamd64: v1
goarm: ""
gomips: ""
env:
- CGO_ENABLED=1
- CC=x86_64-linux-gnu-gcc
- id: sealctl
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
main: ./cmd/sealctl
hooks:
post: upx "{{ .Path }}"
binary: sealctl
goos:
- linux
goarch:
- arm64
- amd64
flags:
- -trimpath
tags:
- containers_image_openpgp
- netgo
- exclude_graphdriver_devicemapper
- static
- osusergo
- exclude_graphdriver_btrfs
ldflags:
- -X github.com/labring/sealos/pkg/version.gitVersion={{.Version}}
- -X github.com/labring/sealos/pkg/version.gitCommit={{.ShortCommit}}
- -X github.com/labring/sealos/pkg/version.buildDate={{.Date}}
- -s -w
overrides:
- goos: linux
goarch: amd64
goamd64: v1
goarm: ""
gomips: ""
env:
- CGO_ENABLED=1
- CC=x86_64-linux-gnu-gcc
- id: lvscare
env:
- CGO_ENABLED=0
main: ./cmd/lvscare
hooks:
post: upx "{{ .Path }}"
binary: lvscare
goos:
- linux
goarch:
- arm64
- amd64
flags:
- -trimpath
tags:
- containers_image_openpgp
- netgo
- exclude_graphdriver_devicemapper
- static
- osusergo
- exclude_graphdriver_btrfs
ldflags:
- -X github.com/labring/sealos/pkg/version.gitVersion={{.Version}}
- -X github.com/labring/sealos/pkg/version.gitCommit={{.ShortCommit}}
- -X github.com/labring/sealos/pkg/version.buildDate={{.Date}}
- -s -w
- id: image-cri-shim
env:
- CGO_ENABLED=0
main: ./cmd/image-cri-shim
hooks:
post: upx "{{ .Path }}"
binary: image-cri-shim
goos:
- linux
goarch:
- arm64
- amd64
flags:
- -trimpath
tags:
- containers_image_openpgp
- netgo
- exclude_graphdriver_devicemapper
- static
- osusergo
- exclude_graphdriver_btrfs
ldflags:
- -X github.com/labring/sealos/pkg/version.gitVersion={{.Version}}
- -X github.com/labring/sealos/pkg/version.gitCommit={{.ShortCommit}}
- -X github.com/labring/sealos/pkg/version.buildDate={{.Date}}
- -s -w
release:
# github:
# name: sealos
prerelease: auto
dockers:
- use: buildx
ids:
- lvscare
goos: linux
goarch: amd64
image_templates:
- ghcr.io/{{ .Env.USERNAME }}/lvscare:{{ .Tag }}-amd64
dockerfile: docker/lvscare/Dockerfile.release
build_flag_templates:
- --pull
- --platform=linux/amd64
- --label=io.sealos.image.created={{.Date}}
- --label=io.sealos.image.title=lvscare
- --label=io.sealos.image.revision={{.ShortCommit}}
- --label=io.sealos.image.version={{.Tag }}
- --label=io.sealos.image.auth={{ .Env.USERNAME }}
- use: buildx
ids:
- lvscare
goos: linux
goarch: arm64
image_templates:
- ghcr.io/{{ .Env.USERNAME }}/lvscare:{{ .Tag }}-arm64
dockerfile: docker/lvscare/Dockerfile.release
build_flag_templates:
- --pull
- --platform=linux/arm64
- --label=io.sealos.image.created={{.Date}}
- --label=io.sealos.image.title=lvscare
- --label=io.sealos.image.revision={{.ShortCommit}}
- --label=io.sealos.image.version={{.Tag }}
- --label=io.sealos.image.auth={{ .Env.USERNAME }}
- use: buildx
ids:
- sealos
goos: linux
goarch: amd64
image_templates:
- ghcr.io/{{ .Env.USERNAME }}/sealos:{{ .Tag }}-amd64
dockerfile: docker/sealos/Dockerfile.release
build_flag_templates:
- --pull
- --platform=linux/amd64
- --label=io.sealos.image.created={{.Date}}
- --label=io.sealos.image.title=sealos
- --label=io.sealos.image.revision={{.ShortCommit}}
- --label=io.sealos.image.version={{.Tag }}
- --label=io.sealos.image.auth={{ .Env.USERNAME }}
- use: buildx
ids:
- sealos
goos: linux
goarch: arm64
image_templates:
- ghcr.io/{{ .Env.USERNAME }}/sealos:{{ .Tag }}-arm64
dockerfile: docker/sealos/Dockerfile.release
build_flag_templates:
- --pull
- --platform=linux/arm64
- --label=io.sealos.image.created={{.Date}}
- --label=io.sealos.image.title=sealos
- --label=io.sealos.image.revision={{.ShortCommit}}
- --label=io.sealos.image.version={{.Tag }}
- --label=io.sealos.image.auth={{ .Env.USERNAME }}
docker_manifests:
- name_template: ghcr.io/{{ .Env.USERNAME }}/lvscare:{{ .Tag }}
image_templates:
- ghcr.io/{{ .Env.USERNAME }}/lvscare:{{ .Tag }}-amd64
- ghcr.io/{{ .Env.USERNAME }}/lvscare:{{ .Tag }}-arm64
- name_template: ghcr.io/{{ .Env.USERNAME }}/sealos:{{ .Tag }}
image_templates:
- ghcr.io/{{ .Env.USERNAME }}/sealos:{{ .Tag }}-amd64
- ghcr.io/{{ .Env.USERNAME }}/sealos:{{ .Tag }}-arm64
nfpms:
- id: packages
builds:
- sealos
vendor: labring
homepage: https://github.com/labring/sealos
maintainer: fanux (https://github.com/fanux)
description: Cloud OS distribution with Kubernetes as kernel
license: Apache 2.0
formats:
- deb
- rpm
publishers:
- name: "fury.io"
ids:
- packages
dir: "{{ dir .ArtifactPath }}"
cmd: |
curl -F package=@{{ .ArtifactName }} https://{{ .Env.FURY_TOKEN }}@push.fury.io/{{ .Env.USERNAME }}/
archives:
- id: archive
checksum:
name_template: "{{ .ProjectName }}_checksums.txt"
algorithm: sha256
ids:
- archive
snapshot:
name_template: "{{ .Tag }}-next"