forked from bpineau/katafygio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.goreleaser.yml
134 lines (121 loc) · 3.89 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
# Goreleaser configuration to build and publish releases on new v* github tags
# (via Github Actions, cf. .github/workflows/release.yml):
# - Build (x86, x86_64, arm64) binaries for Linux, Windows and Mac
# - Build deb and rpm packages
# - Build docker images
# - Publish Github releases (as draft, for manual confirmation)
# - Publish docker images (to docker hub and quay.io)
# - Publish homebrew formula (to https://github.com/bpineau/homebrew-tap)
# Test changes to this file localy with:
# env HOMEBREW_TAP_GITHUB_TOKEN=fake goreleaser release --rm-dist --skip-publish --skip-sign --skip-validate
# Verify goreleaser upgrades with (cf. https://goreleaser.com/deprecations/):
# goreleaser check
builds:
- id: default
ldflags: -s -w -X github.com/bpineau/katafygio/cmd.version={{.Version}}
env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- darwin
- linux
- windows
goarch:
- amd64
- arm
- arm64
- "386"
hooks:
post: make man
# need for "brews" publisher, that doesn't work with flat binaries (see "archives" below)
- id: macosx-tarball
ldflags: -s -w -X github.com/bpineau/katafygio/cmd.version={{.Version}}
env:
- CGO_ENABLED=0
- GO111MODULE=on
goos:
- darwin
goarch:
- amd64
# TODO will be supported in go 1.16 (see https://github.com/goreleaser/goreleaser/issues/1903)
#- arm64
hooks:
post: make man
before:
hooks:
- go mod download
release:
# publish github releases as draft, so a human can check and validate
draft: true
archives:
- id: katafygio
format: binary
builds: [default] # publish easy to curl flag files rather than tarballs
- id: macosx-tarball
builds: [macosx-tarball] # for brews below (needs a tarball)
changelog:
filters:
exclude:
- Merge
dockers:
# TODO when stable, use "docker_manifest" to publish multi-arch images
- image_templates:
- "bpineau/katafygio:latest"
- "bpineau/katafygio:{{ .Tag }}"
- "bpineau/katafygio:v{{ .Major }}.{{ .Minor }}"
- "quay.io/bpineau/katafygio:latest"
- "quay.io/bpineau/katafygio:{{ .Tag }}"
- "quay.io/bpineau/katafygio:v{{ .Major }}.{{ .Minor }}"
goos: linux
goarch: amd64
builds: [default]
dockerfile: assets/Dockerfile.goreleaser
skip_push: false
build_flag_templates:
- "--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}}"
nfpms:
-
file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Arch }}"
homepage: https://github.com/bpineau/katafygio
description: Discover and continuously backup Kubernetes objets as yaml files in git
maintainer: Benjamin Pineau <[email protected]>
license: MIT
bindir: /usr/bin
vendor: Benjamin Pineau
formats:
- deb
- rpm
dependencies:
- git
config_files:
"./assets/katafygio.yaml": "/etc/katafygio/katafygio.yaml"
files:
"./katafygio.8.gz": "/usr/share/man/man8/katafygio.8.gz"
overrides:
rpm:
replacements:
amd64: x86_64
386: i686
file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
deb:
replacements:
386: i386
file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
brews:
- name: katafygio
ids: [macosx-tarball] # because brews publisher doesn't accept flat binaries
tap:
owner: bpineau
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
folder: Formula
homepage: "https://github.com/bpineau/katafygio"
description: Discover and continuously backup Kubernetes objets as yaml files in git
license: MIT
skip_upload: false
test: |
system "#{bin}/katafygio version"