forked from cunicu/cunicu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.goreleaser.yaml
331 lines (275 loc) · 9.16 KB
/
.goreleaser.yaml
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
# SPDX-FileCopyrightText: 2023 Steffen Vogel <[email protected]>
# SPDX-License-Identifier: Apache-2.0
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
---
project_name: cunicu
before:
hooks:
- make prepare LINT_OPTS=--timeout=15m
checksum:
name_template: "checksums.txt"
algorithm: sha256
# Signing is disabled here as we can not perform it in the CI
# Its is expected that the maintainer adds the checksum.asc file to the release by hand
# after the CI pipeline has created the release.
# This procedure is automated by the script: scripts/sign_release.sh
# signs:
# - artifacts: checksum
# signature: "${artifact}.asc"
# cmd: gpg
# args: ["-u", "09BE3BAE8D55D4CD8579285A9675EAC34897E6E2", "--output", "${signature}", "--detach-sign", "${artifact}"]
builds:
- id: cunicu
main: ./cmd/cunicu
binary: cunicu
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
# TODO: FreeBSD builds require cgo and FreeBSD
# system headers.
# - freebsd
goarch:
- amd64
- arm64
- mips64
- mips64le
- riscv64
- ppc64le
- s390x
- "386"
- arm
- mips
- mipsle
goarm:
- "7"
gomips:
- softfloat
ignore:
- goos: windows
goarch: arm
- goos: windows
goarch: "386"
ldflags:
- -s
- -w
- -X github.com/stv0g/cunicu/pkg/buildinfo.Version=v{{.Version}}
- -X github.com/stv0g/cunicu/pkg/buildinfo.Commit={{.Commit}}
- -X github.com/stv0g/cunicu/pkg/buildinfo.DateStr={{.Date}}
- -X github.com/stv0g/cunicu/pkg/buildinfo.Tag={{.Tag}}
- -X github.com/stv0g/cunicu/pkg/buildinfo.Branch={{.Branch}}
- -X github.com/stv0g/cunicu/pkg/buildinfo.BuiltBy=goreleaser
archives:
- id: cunicu
builds:
- cunicu
format: tar.gz
files:
- LICENSE
- README.md
- etc/systemd/*
- completions/*
- etc/cunicu.yaml
- etc/cunicu.advanced.yaml
- src: docs/usage/man/*
dst: man/
strip_parent: true
format_overrides:
- goos: windows
format: zip
rlcp: true
nfpms:
- vendor: stv0g
homepage: https://github.com/stv0g/cunicu/
maintainer: Steffen Vogel <[email protected]>
license: Apache 2.0
formats:
- apk
- deb
- rpm
recommends:
- wireguard-tools
contents:
- src: "./etc/systemd/cunicu.service"
dst: "/usr/lib/systemd/system/cunicu.service"
file_info:
mode: 0644
- src: "./etc/cunicu.yaml"
dst: "/etc/cunicu.example.yaml"
type: config
file_info:
mode: 0644
- src: "./etc/cunicu.advanced.yaml"
dst: "/etc/cunicu.advanced-example.yaml"
type: config
file_info:
mode: 0644
- src: "./docs/usage/man/*.1"
dst: "/usr/share/man/man1"
file_info:
mode: 0644
- src: ./completions/cunicu.bash
dst: /usr/share/bash-completion/completions/cunicu
file_info:
mode: 0644
- src: ./completions/cunicu.fish
dst: /usr/share/fish/completions/cunicu.fish
file_info:
mode: 0644
- src: ./completions/cunicu.zsh
dst: /usr/share/zsh/vendor-completions/_cunicu
file_info:
mode: 0644
dockers:
- use: buildx
dockerfile: Dockerfile.scratch
goos: linux
goarch: amd64
image_templates:
- "ghcr.io/stv0g/{{ .ProjectName }}:latest-amd64"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Major }}-amd64"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-amd64"
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/stv0g/{{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/stv0g/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=Apache-2.0
- use: buildx
dockerfile: Dockerfile.scratch
goos: linux
goarch: arm64
image_templates:
- "ghcr.io/stv0g/{{ .ProjectName }}:latest-arm64v8"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Major }}-arm64v8"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}-arm64v8"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-arm64v8"
build_flag_templates:
- --platform=linux/arm64/v8
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/stv0g/{{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/stv0g/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=Apache-2.0
- use: buildx
dockerfile: Dockerfile.scratch
goos: linux
goarch: arm
goarm: "7"
image_templates:
- "ghcr.io/stv0g/{{ .ProjectName }}:latest-armv7"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Major }}-armv7"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}-armv7"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}-armv7"
build_flag_templates:
- --platform=linux/arm/v7
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.description={{ .ProjectName }}
- --label=org.opencontainers.image.url=https://github.com/stv0g/{{ .ProjectName }}
- --label=org.opencontainers.image.source=https://github.com/stv0g/{{ .ProjectName }}
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=Apache-2.0
docker_manifests:
- name_template: "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Version }}"
image_templates:
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Version }}-amd64"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Version }}-armv7"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Version }}-arm64v8"
- name_template: "ghcr.io/stv0g/{{ .ProjectName }}:latest"
image_templates:
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Version }}-amd64"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Version }}-armv7"
- "ghcr.io/stv0g/{{ .ProjectName }}:v{{ .Version }}-arm64v8"
snapshot:
name_template: "{{ incpatch .Version }}-next"
publishers:
- name: Gemfury
cmd: >-
bash -c "
if [[ ${ARTIFACT_PATH} == *.rpm || ${ARTIFACT_PATH} == *.deb ]]; then
curl -F package=@${ARTIFACT_PATH} https://${GEMFURY_TOKEN}@push.fury.io/cunicu/
fi
"
env:
- GEMFURY_TOKEN={{ .Env.GEMFURY_TOKEN }}
- ARTIFACT_PATH={{ .ArtifactPath }}
universal_binaries:
- replace: true
brews:
- ids:
- cunicu
tap:
owner: stv0g
name: homebrew-cunicu
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
homepage: "https://cunicu.li"
description: "A zeroconf peer-to-peer mesh VPN using Wireguard® and Interactive Connectivity Establishment (ICE)"
license: "Apache-2.0"
dependencies:
- name: bash-completion
type: optional
- name: wireguard-tools
type: optional
install: |-
bin.install "cunicu"
etc.install "etc/cunicu.yaml", "etc/cunicu.advanced.yaml"
bash_completion.install "completions/cunicu.bash" => "cunicu"
zsh_completion.install "completions/cunicu.zsh" => "_cunicu"
fish_completion.install "completions/cunicu.fish"
man1.install Dir["man/*.1"]
aurs:
- ids:
- cunicu
homepage: "https://cunicu.li"
description: "A zeroconf peer-to-peer mesh VPN using Wireguard® and Interactive Connectivity Establishment (ICE)"
license: "Apache-2.0"
maintainers:
- 'Steffen Vogel <[email protected]>'
private_key: '{{ .Env.AUR_KEY }}'
git_url: 'ssh://[email protected]/cunicu-bin.git'
skip_upload: auto
optdepends:
- 'bash-completion: for shell completions'
- 'wireguard-tools: for controlling WireGuard interfaces'
package: |-
# bin
install -Dm755 "./cunicu" "${pkgdir}/usr/bin/cunicu"
# config
install -Dm644 "./etc/cunicu.yaml" "${pkgdir}/etc/cunicu.example.yaml"
install -Dm644 "./etc/systemd/cunicu.service" "${pkgdir}/usr/lib/systemd/cunicu.service"
# license
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/cunicu/LICENSE"
# manpages
install -d "${pkgdir}/usr/share/man/man1"
install -Dm644 ./man/*.1 "${pkgdir}/usr/share/man/man1"
# completions
mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
install -Dm644 "./completions/cunicu.bash" "${pkgdir}/usr/share/bash-completion/completions/cunicu"
install -Dm644 "./completions/cunicu.zsh" "${pkgdir}/usr/share/zsh/site-functions/_cunicu"
install -Dm644 "./completions/cunicu.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/cunicu.fish"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
release:
github:
owner: stv0g
name: cunicu
draft: true
prerelease: auto