-
Notifications
You must be signed in to change notification settings - Fork 34
/
.goreleaser.yml
230 lines (213 loc) · 5.86 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
project_name: resticprofile
version: 2
before:
hooks:
- go mod download
- go generate ./...
- eget rclone/rclone --upgrade-only --system=linux/amd64 --to=build/rclone-amd64 --asset=zip
- eget rclone/rclone --upgrade-only --system=linux/arm64 --to=build/rclone-arm64 --asset=zip
- eget restic/restic --upgrade-only --system=linux/amd64 --to=build/restic-amd64
- eget restic/restic --upgrade-only --system=linux/arm64 --to=build/restic-arm64
builds:
- id: resticprofile_targz
env:
- CGO_ENABLED=0
goos:
- darwin
- freebsd
- linux
- netbsd
- openbsd
- solaris
- windows
goarch:
- "386"
- amd64
- arm
- arm64
- mips
- mips64
- mips64le
- mipsle
- ppc64
- ppc64le
- riscv64
- s390x
goarm:
- "6"
- "7"
ignore:
- goos: freebsd
goarch: arm64
- goos: freebsd
goarch: riscv64
- goos: netbsd
goarch: "386"
- goos: netbsd
goarch: arm
- goos: netbsd
goarch: arm64
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: openbsd
goarch: arm
- goos: openbsd
goarch: arm64
- goos: openbsd
goarch: ppc64
- id: resticprofile_zip
env:
- CGO_ENABLED=0
goos:
- darwin
- windows
goarch:
- "386"
- amd64
- arm64
- id: resticprofile_no_self_update
env:
- CGO_ENABLED=0
flags:
- -tags=no_self_update
goos:
- darwin
- freebsd
- linux
- windows
goarch:
- "386"
- amd64
- arm
- arm64
goarm:
- "6"
- "7"
ignore:
- goos: darwin
goarch: "386"
- goos: darwin
goarch: arm
- goos: freebsd
goarch: arm64
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
archives:
- id: targz
builds:
- resticprofile_targz
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
format: tar.gz
- id: targz_no_self_update
builds:
- resticprofile_no_self_update
name_template: '{{ .ProjectName }}_no_self_update_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
format: tar.gz
- id: zip
builds:
- resticprofile_zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}'
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
version_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
dockers:
- image_templates:
- "creativeprojects/resticprofile:latest-amd64"
- "creativeprojects/resticprofile:{{ .RawVersion }}-amd64"
ids:
- resticprofile_targz
use: buildx
goos: linux
goarch: amd64
dockerfile: build/Dockerfile
extra_files:
- build/restic-amd64
- build/rclone-amd64
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}}"
- "--platform=linux/amd64"
- "--build-arg=ARCH=amd64"
- image_templates:
- "creativeprojects/resticprofile:latest-arm64v8"
- "creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8"
ids:
- resticprofile_targz
use: buildx
goos: linux
goarch: arm64
dockerfile: build/Dockerfile
extra_files:
- build/restic-arm64
- build/rclone-arm64
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}}"
- "--platform=linux/arm64/v8"
- "--build-arg=ARCH=arm64"
docker_manifests:
- name_template: creativeprojects/resticprofile:{{ .RawVersion }}
image_templates:
- creativeprojects/resticprofile:{{ .RawVersion }}-amd64
- creativeprojects/resticprofile:{{ .RawVersion }}-arm64v8
- name_template: creativeprojects/resticprofile:latest
image_templates:
- creativeprojects/resticprofile:latest-amd64
- creativeprojects/resticprofile:latest-arm64v8
brews:
-
name: resticprofile
ids:
- targz_no_self_update
goarm: "6"
repository:
owner: creativeprojects
name: "homebrew-tap"
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
commit_author:
name: goreleaser
email: [email protected]
directory: Formula
homepage: https://github.com/creativeprojects/{{ .ProjectName }}
description: Configuration profiles for restic backup
license: "GPL-3.0-only"
custom_block: |
head "https://github.com/creativeprojects/{{ .ProjectName }}.git"
dependencies:
- name: restic
type: optional
install: |
bin.install "{{ .ProjectName }}"
test: |
(testpath/"restic_repo").mkdir
(testpath/"password.txt").write("key")
(testpath/"profiles.yaml").write <<~EOS
default:
repository: "local:#{testpath}/restic_repo"
password-file: "password.txt"
initialize: true
EOS
(testpath/"testfile").write("This is a testfile")
system "#{bin}/resticprofile", "backup", "testfile"
system "#{bin}/resticprofile", "restore", "latest", "-t", "#{testpath}/restore"
assert compare_file "testfile", "#{testpath}/restore/testfile"
release:
draft: true