forked from ethersphere/bee
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.goreleaser.yml
528 lines (495 loc) · 17.9 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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
project_name: bee
version: 2
release:
prerelease: auto
git:
prerelease_suffix: "-"
builds:
- id: linux
main: ./cmd/bee
binary: bee
flags:
- -v
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- 386
- arm64
- arm
goarm:
- 7
- id: linux-slim
main: ./cmd/bee
binary: bee-slim
flags:
- -v
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
- arm
goarm:
- 7
hooks:
post:
- upx --best "{{ .Path }}"
- id: windows
main: ./cmd/bee
binary: bee
flags:
- -v
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
- windows
goarch:
- amd64
- 386
- id: darwin-amd64
main: ./cmd/bee
binary: bee
flags:
- -v
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- amd64
- id: darwin-arm64
main: ./cmd/bee
binary: bee
flags:
- -v
- -trimpath
ldflags:
- -s -w
- -X github.com/ethersphere/bee/v2.version={{ .Version }}
- -X github.com/ethersphere/bee/v2.commitHash={{ .ShortCommit }}
- -X github.com/ethersphere/bee/v2.commitTime={{ .CommitTimestamp }}
- -X github.com/ethersphere/bee/v2/pkg/api.Version={{ .Env.BEE_API_VERSION }}
env:
- CGO_ENABLED=0
goos:
- darwin
goarch:
- arm64
snapshot:
name_template: "{{.Tag}}-snapshot"
signs:
- artifacts: checksum
args: [
"--pinentry-mode", "loopback",
"--passphrase", "{{ .Env.GPG_PASSPHRASE }}",
"-u", "{{ .Env.GPG_FINGERPRINT }}",
"--output", "${signature}",
"--detach-sign", "${artifact}",
]
archives:
-
id: scoop
builds:
- windows
name_template: "{{ tolower .ProjectName }}-{{ tolower .Os }}-{{ tolower .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format: zip
wrap_in_directory: false
files:
- packaging/scoop/bee.yaml
- LICENSE
- README.md
-
name_template: "{{ tolower .ProjectName }}-{{ tolower .Os }}-{{ tolower .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format: binary
builds:
- linux
- windows
- darwin-amd64
- darwin-arm64
-
id: homebrew-amd64
builds:
- darwin-amd64
name_template: "{{ tolower .ProjectName }}-{{ tolower .Os }}-{{ tolower .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- src: 'packaging/homebrew-amd64/*'
dst: '.'
strip_parent: true
- LICENSE
- README.md
-
id: homebrew-arm64
builds:
- darwin-arm64
name_template: "{{ tolower .ProjectName }}-{{ tolower .Os }}-{{ tolower .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- src: 'packaging/homebrew-arm64/*'
dst: '.'
strip_parent: true
- LICENSE
- README.md
nfpms:
- file_name_template: >-
{{ tolower .ProjectName }}_
{{- tolower .Version }}_
{{- if eq .Arch "arm" }}armhf
{{- else }}{{ tolower .Arch }}{{ end }}
id: packages
vendor: Swarm Foundation
homepage: https://www.ethswarm.org
maintainer: Swarm Devops <[email protected]>
description: Ethereum Swarm node
license: GPL-3
dependencies:
- ca-certificates
- adduser
formats:
- deb
- rpm
contents:
- src: packaging/bee.service
dst: /lib/systemd/system/bee.service
- src: packaging/bee-get-addr
dst: /usr/bin/bee-get-addr
- src: packaging/bee.yaml
dst: /etc/bee/bee.yaml
type: config
- src: packaging/default
dst: /etc/default/bee
type: config
overrides:
deb:
dependencies:
- passwd
- ca-certificates
scripts:
preinstall: ./packaging/deb/preinst
postinstall: ./packaging/deb/postinst
preremove: ./packaging/deb/prerm
postremove: ./packaging/deb/postrm
rpm:
dependencies:
- ca-certificates
- shadow-utils
file_name_template: >-
{{ tolower .ProjectName }}-
{{- tolower .Version }}.
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "arm64" }}aarch64
{{- else }}{{ tolower .Arch }}{{ end }}
scripts:
preinstall: ./packaging/rpm/pre
postinstall: ./packaging/rpm/post
preremove: ./packaging/rpm/preun
postremove: ./packaging/rpm/postun
bindir: /usr/bin
publishers:
- name: gemfury
ids:
- packages
dir: "{{ dir .ArtifactPath }}"
cmd: bash -c "if [[ \"{{ .Prerelease }}\" == \"\" ]]; then curl -F package=@{{ .ArtifactName }} https://{{ .Env.GEMFURY_TOKEN }}@push.fury.io/ethersphere/; else echo SKIPPING PRERELEASE!; fi"
scoops:
- url_template: "https://github.com/ethersphere/bee/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
repository:
owner: ethersphere
name: scoop
token: "{{ .Env.SCOOP_PAT }}"
commit_author:
name: bee-worker
email: [email protected]
commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}"
homepage: "https://github.com/ethersphere/bee"
description: "Swarm client implemented in Go."
license: BSD-3-Clause
persist:
- "data"
- "packaging/scoop/bee.yaml"
post_install:
- "Write-Host 'Running postinstall command'"
- "if(!(Test-Path $persist_dir\\bee.yaml)){New-Item -ItemType SymbolicLink -Path \"$persist_dir\\bee.yaml\" -Target \"$persist_dir\\packaging\\scoop\\bee.yaml\" | Out-Null}"
- "(Get-Content -path $persist_dir\\bee.yaml -Raw) -replace './bee.yaml',\"$persist_dir\\bee.yaml\" | Set-Content -Path $persist_dir\\bee.yaml"
- "(Get-Content -path $persist_dir\\bee.yaml -Raw) -replace './data',\"$persist_dir\\data\" | Set-Content -Path $persist_dir\\bee.yaml"
- "(Get-Content -path $persist_dir\\bee.yaml -Raw) -replace './password',\"$persist_dir\\password\" | Set-Content -Path $persist_dir\\bee.yaml"
- "if(!(Test-Path $persist_dir\\password)){[System.Web.Security.Membership]::GeneratePassword(32,5) | Set-Content -Path $persist_dir\\password}"
- "if(sc.exe query SwarmBeeSvc | Select-String FAILED){sc.exe create SwarmBeeSvc binPath= \"$dir\\bee.exe start --config=$persist_dir\\bee.yaml\" type= share start= auto displayName= \"Bee\"; sc.exe description SwarmBeeSvc \"Swarm client implemented in Go.\"}"
- "if($global){$ETH_ADDRESS = (((C:\\ProgramData\\scoop\\shims\\bee.exe init --config=$persist_dir\\bee.yaml | Select-String ethereum) -split ' ‘)[-1]).Trim('\"')} else {$ETH_ADDRESS = (((bee.exe init --config=$persist_dir\\bee.yaml | Select-String ethereum) -split ' ‘)[-1]).Trim('\"')}; Write-Host \"Please make sure there is XDAI and, if required, XBZZ available on the following Ethereum address on Gnosis Chain: $ETH_ADDRESS\nLearn how to fund your node by visiting our docs at https://docs.ethswarm.org/docs/installation/fund-your-node\""
- "Write-Host \"Bee requires a Gnosis Chain RPC endpoint to function. By default this is expected to be found at ws://localhost:8546.\nPlease see https://docs.ethswarm.org/docs/installation/install for more details on how to configure your node.\nConfig: $persist_dir\\bee.yaml\""
- "Write-Host \"Once your node's wallet has received the funds deploy Bee chequebook with [sudo] $dir\\bee.exe deploy --config=$persist_dir\\bee.yaml\""
- "Write-Host 'Start Bee service with [sudo] sc.exe start SwarmBeeSvc'"
brews:
- name: swarm-bee
repository:
owner: ethersphere
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_PAT }}"
ids:
- homebrew-amd64
- homebrew-arm64
commit_author:
name: bee-worker
email: [email protected]
homepage: https://swarm.ethereum.org/
description: Ethereum Swarm node
caveats: |
Logs: #{var}/log/swarm-bee/bee.log
Config: #{etc}/swarm-bee/bee.yaml
Bee requires a Gnosis Chain RPC endpoint to function. By default this is expected to be found at ws://localhost:8546.
Please see https://docs.ethswarm.org/docs/installation/install for more details on how to configure your node.
After you finish configuration run 'bee-get-addr' and fund your node with XDAI, and also XBZZ if so desired.
test: |
system "#{bin}/bee version"
install: |
(etc/"swarm-bee").mkpath
(var/"lib/swarm-bee").mkpath
bin.install ["bee", "bee-get-addr"]
etc.install "bee.yaml" => "swarm-bee/bee.yaml" unless File.exists? etc/"swarm-bee/bee.yaml"
post_install: |
unless File.exists? "#{var}/lib/swarm-bee/password"
system("openssl", "rand", "-out", var/"lib/swarm-bee/password", "-base64", "32")
end
system(bin/"bee", "init", "--config", etc/"swarm-bee/bee.yaml", ">/dev/null", "2>&1")
service: |
run [bin/"bee", "start", "--config", etc/"swarm-bee/bee.yaml"]
keep_alive true
error_log_path var/"log/swarm-bee/bee.log"
log_path var/"log/swarm-bee/bee.log"
dockers:
- image_templates:
- "ethersphere/bee:{{ .Version }}-amd64"
- "quay.io/ethersphere/bee:{{ .Version }}-amd64"
use: buildx
ids:
- linux
goarch: amd64
dockerfile: Dockerfile.goreleaser
build_flag_templates:
- "--platform=linux/amd64"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- image_templates:
- "ethersphere/bee:{{ .Version }}-armv7"
- "quay.io/ethersphere/bee:{{ .Version }}-armv7"
use: buildx
ids:
- linux
goarch: arm
goarm: 7
dockerfile: Dockerfile.goreleaser
build_flag_templates:
- "--platform=linux/arm/v7"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- image_templates:
- "ethersphere/bee:{{ .Version }}-arm64v8"
- "quay.io/ethersphere/bee:{{ .Version }}-arm64v8"
use: buildx
ids:
- linux
goarch: arm64
dockerfile: Dockerfile.goreleaser
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- image_templates:
- "ethersphere/bee:{{ .Version }}-amd64-slim"
- "quay.io/ethersphere/bee:{{ .Version }}-amd64-slim"
use: buildx
ids:
- linux-slim
goarch: amd64
dockerfile: Dockerfile.scratch
build_flag_templates:
- "--platform=linux/amd64"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}-slim"
- image_templates:
- "ethersphere/bee:{{ .Version }}-armv7-slim"
- "quay.io/ethersphere/bee:{{ .Version }}-armv7-slim"
use: buildx
ids:
- linux-slim
goarch: arm
goarm: 7
dockerfile: Dockerfile.scratch
build_flag_templates:
- "--platform=linux/arm/v7"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}-slim"
- image_templates:
- "ethersphere/bee:{{ .Version }}-arm64v8-slim"
- "quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim"
use: buildx
ids:
- linux-slim
goarch: arm64
dockerfile: Dockerfile.scratch
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}-slim"
docker_manifests:
- name_template: ethersphere/bee:{{ .Major }}
image_templates:
- ethersphere/bee:{{ .Version }}-amd64
- ethersphere/bee:{{ .Version }}-armv7
- ethersphere/bee:{{ .Version }}-arm64v8
skip_push: auto
- name_template: ethersphere/bee:{{ .Major }}.{{ .Minor }}
image_templates:
- ethersphere/bee:{{ .Version }}-amd64
- ethersphere/bee:{{ .Version }}-armv7
- ethersphere/bee:{{ .Version }}-arm64v8
skip_push: auto
- name_template: ethersphere/bee:{{ .Major }}.{{ .Minor }}.{{ .Patch }}{{ with .Prerelease }}-{{ . }}{{ end }}
image_templates:
- ethersphere/bee:{{ .Version }}-amd64
- ethersphere/bee:{{ .Version }}-armv7
- ethersphere/bee:{{ .Version }}-arm64v8
- name_template: ethersphere/bee:latest
image_templates:
- ethersphere/bee:{{ .Version }}-amd64
- ethersphere/bee:{{ .Version }}-armv7
- ethersphere/bee:{{ .Version }}-arm64v8
- name_template: ethersphere/bee:stable
image_templates:
- ethersphere/bee:{{ .Version }}-amd64
- ethersphere/bee:{{ .Version }}-armv7
- ethersphere/bee:{{ .Version }}-arm64v8
skip_push: auto
- name_template: quay.io/ethersphere/bee:{{ .Major }}
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64
- quay.io/ethersphere/bee:{{ .Version }}-armv7
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8
skip_push: auto
- name_template: quay.io/ethersphere/bee:{{ .Major }}.{{ .Minor }}
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64
- quay.io/ethersphere/bee:{{ .Version }}-armv7
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8
skip_push: auto
- name_template: quay.io/ethersphere/bee:{{ .Major }}.{{ .Minor }}.{{ .Patch }}{{ with .Prerelease }}-{{ . }}{{ end }}
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64
- quay.io/ethersphere/bee:{{ .Version }}-armv7
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8
- name_template: quay.io/ethersphere/bee:latest
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64
- quay.io/ethersphere/bee:{{ .Version }}-armv7
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8
- name_template: quay.io/ethersphere/bee:stable
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64
- quay.io/ethersphere/bee:{{ .Version }}-armv7
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8
skip_push: auto
- name_template: ethersphere/bee:{{ .Major }}-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8-slim
skip_push: auto
- name_template: ethersphere/bee:{{ .Major }}.{{ .Minor }}-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8-slim
skip_push: auto
- name_template: ethersphere/bee:{{ .Major }}.{{ .Minor }}.{{ .Patch }}{{ with .Prerelease }}-{{ . }}{{ end }}-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8
- name_template: ethersphere/bee:latest-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: ethersphere/bee:stable-slim
image_templates:
- ethersphere/bee:{{ .Version }}-amd64-slim
- ethersphere/bee:{{ .Version }}-armv7-slim
- ethersphere/bee:{{ .Version }}-arm64v8-slim
skip_push: auto
- name_template: quay.io/ethersphere/bee:{{ .Major }}-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
skip_push: auto
- name_template: quay.io/ethersphere/bee:{{ .Major }}.{{ .Minor }}-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
skip_push: auto
- name_template: quay.io/ethersphere/bee:{{ .Major }}.{{ .Minor }}.{{ .Patch }}{{ with .Prerelease }}-{{ . }}{{ end }}-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: quay.io/ethersphere/bee:latest-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
- name_template: quay.io/ethersphere/bee:stable-slim
image_templates:
- quay.io/ethersphere/bee:{{ .Version }}-amd64-slim
- quay.io/ethersphere/bee:{{ .Version }}-armv7-slim
- quay.io/ethersphere/bee:{{ .Version }}-arm64v8-slim
skip_push: auto