1
+ # Goreleaser configuration to build and publish releases on new v* github tags
2
+ # (via Github Actions, cf. .github/workflows/release.yml):
3
+ # - Build (x86, x86_64, arm64) binaries for Linux, Windows and Mac
4
+ # - Build deb and rpm packages
5
+ # - Build docker images
6
+ # - Publish Github releases (as draft, for manual confirmation)
7
+ # - Publish docker images (to docker hub and quay.io)
8
+ # - Publish homebrew formula (to https://github.com/bpineau/homebrew-tap)
9
+
10
+ # Test changes to this file localy with:
11
+ # env HOMEBREW_TAP_GITHUB_TOKEN=fake goreleaser release --rm-dist --skip-publish --skip-sign --skip-validate
12
+ # Verify goreleaser upgrades with (cf. https://goreleaser.com/deprecations/):
13
+ # goreleaser check
14
+
1
15
builds :
2
- -
16
+ - id : default
3
17
ldflags : -s -w -X github.com/bpineau/katafygio/cmd.version={{.Version}}
4
18
env :
5
19
- CGO_ENABLED=0
@@ -15,32 +29,61 @@ builds:
15
29
- " 386"
16
30
hooks :
17
31
post : make man
32
+ # need for "brews" publisher, that doesn't work with flat binaries (see "archives" below)
33
+ - id : macosx-tarball
34
+ ldflags : -s -w -X github.com/bpineau/katafygio/cmd.version={{.Version}}
35
+ env :
36
+ - CGO_ENABLED=0
37
+ - GO111MODULE=on
38
+ goos :
39
+ - darwin
40
+ goarch :
41
+ - amd64
42
+ # TODO will be supported in go 1.16 (see https://github.com/goreleaser/goreleaser/issues/1903)
43
+ # - arm64
44
+ hooks :
45
+ post : make man
18
46
19
47
before :
20
48
hooks :
21
49
- go mod download
22
50
23
51
release :
24
- # don't autopublish
52
+ # publish github releases as draft, so a human can check and validate
25
53
draft : true
26
54
27
55
archives :
28
56
- id : katafygio
29
57
format : binary
58
+ builds : [default] # publish easy to curl flag files rather than tarballs
59
+ - id : macosx-tarball
60
+ builds : [macosx-tarball] # for brews below (needs a tarball)
30
61
31
62
changelog :
32
63
filters :
33
64
exclude :
34
65
- Merge
35
66
36
67
dockers :
68
+ # TODO when stable, use "docker_manifest" to publish multi-arch images
37
69
- image_templates :
38
70
- " bpineau/katafygio:latest"
39
71
- " bpineau/katafygio:{{ .Tag }}"
72
+ - " bpineau/katafygio:v{{ .Major }}.{{ .Minor }}"
73
+ - " quay.io/bpineau/katafygio:latest"
74
+ - " quay.io/bpineau/katafygio:{{ .Tag }}"
75
+ - " quay.io/bpineau/katafygio:v{{ .Major }}.{{ .Minor }}"
40
76
goos : linux
41
77
goarch : amd64
78
+ builds : [default]
42
79
dockerfile : assets/Dockerfile.goreleaser
43
- skip_push : true
80
+ skip_push : false
81
+ build_flag_templates :
82
+ - " --pull"
83
+ - " --label=org.opencontainers.image.created={{.Date}}"
84
+ - " --label=org.opencontainers.image.title={{.ProjectName}}"
85
+ - " --label=org.opencontainers.image.revision={{.FullCommit}}"
86
+ - " --label=org.opencontainers.image.version={{.Version}}"
44
87
45
88
nfpms :
46
89
-
@@ -70,3 +113,22 @@ nfpms:
70
113
replacements :
71
114
386 : i386
72
115
file_name_template : " {{ .ProjectName }}_{{ .Version }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
116
+
117
+ brews :
118
+ - name : katafygio
119
+ ids : [macosx-tarball] # because brews publisher doesn't accept flat binaries
120
+
121
+ tap :
122
+ owner : bpineau
123
+ name : homebrew-tap
124
+ token : " {{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
125
+
126
+ folder : Formula
127
+ homepage : " https://github.com/bpineau/katafygio"
128
+ description : Discover and continuously backup Kubernetes objets as yaml files in git
129
+ license : MIT
130
+ skip_upload : false
131
+
132
+ test : |
133
+ system "#{bin}/katafygio version"
134
+
0 commit comments