-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.goreleaser.ytt.yml
144 lines (137 loc) · 3.97 KB
/
.goreleaser.ytt.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
#@ project_name = 'cloudflare-dynamic-dns'
#@ description = 'Dynamic DNS client for Cloudflare with IPv6/IPv4 support'
#@ maintainer = 'German Lashevich <[email protected]>'
#@ url = 'https://github.com/zebradil/cloudflare-dynamic-dns'
#@ committer_name = 'Zebradil Bot'
#@ committer_email = '[email protected]'
#@ targets = [
#@ ("linux", "amd64", ""),
#@ ("linux", "386", ""),
#@ ("linux", "arm64", ""),
#@ ("linux", "arm", "6"),
#@ ("linux", "arm", "7"),
#@ ("linux", "mips", ""),
#@ ("linux", "mipsle", ""),
#@ ("linux", "mips64", ""),
#@ ("linux", "mips64le", ""),
#@ ("darwin", "amd64", ""),
#@ ("darwin", "arm64", ""),
#@ ("windows", "amd64", ""),
#@ ("windows", "386", ""),
#@ ]
#@ docker_targets = [
#@ ("linux", "amd64", ""),
#@ ("linux", "arm64", ""),
#@ ("linux", "arm", "6"),
#@ ("linux", "arm", "7"),
#@ ]
#@ versions = [
#@ '{{ .Tag }}',
#@ '{{ .Major }}',
#@ '{{ .Major }}.{{ .Minor }}',
#@ 'latest',
#@ ]
#@ base_image = 'ghcr.io/zebradil/' + project_name
#@ def make_target(os, arch, arm):
#@ target = os + "_" + arch
#@ if arm:
#@ target += "_" + arm
#@ end
#@ return target
#@ end
#@ def make_image(version, os, arch, arm):
#@ image = base_image + ":" + version + "-" + os + "-" + arch
#@ if arm:
#@ image += "-" + arm
#@ end
#@ return image
#@ end
#@ def make_platform(os, arch, arm):
#@ platform = "--platform=" + os + "/" + arch
#@ if arm:
#@ platform += "/" + arm
#@ end
#@ return platform
#@ end
---
version: 2
project_name: #@ project_name
before:
hooks:
- go mod tidy
builds:
- binary: #@ project_name
env:
- CGO_ENABLED=0
targets:
#@ for/end os, arch, arm in targets:
- #@ make_target(os, arch, arm)
archives:
- name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md
- systemd/*
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Version }}-next"
aurs:
- name: #@ project_name + "-bin"
homepage: #@ url
description: #@ description
maintainers:
- #@ maintainer
license: "MIT"
private_key: "{{ .Env.AUR_SSH_KEY }}"
git_url: #@ "ssh://[email protected]/{}-bin.git".format(project_name)
#@yaml/text-templated-strings
package: |-
BIN=(@= project_name @)
install -Dm755 ./$BIN -t "${pkgdir}/usr/bin"
install -Dm644 systemd/* -t "$pkgdir"/usr/lib/systemd/system
install -m700 -d "$pkgdir"/etc/cloudflare-dynamic-dns/config.d
# 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/"
./$BIN completion bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/$BIN"
./$BIN completion fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/$BIN.fish"
./$BIN completion zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_$BIN"
commit_author:
name: #@ committer_name
email: #@ committer_email
nfpms:
- vendor: Zebradil
homepage: #@ url
maintainer: #@ maintainer
description: #@ description
license: MIT
formats:
- apk
- deb
- rpm
contents:
- src: systemd/
dst: /usr/lib/systemd/system/
dockers:
#@ for/end os, arch, arm in docker_targets:
- goos: #@ os
goarch: #@ arch
#@ if/end arm:
goarm: #@ arm
image_templates:
#@ for/end version in versions:
- #@ make_image(version, os, arch, arm)
use: buildx
build_flag_templates:
- #@ make_platform(os, arch, arm)
docker_manifests:
#@ for/end version in versions:
- name_template: #@ base_image + ":" + version
image_templates:
#@ for/end os, arch, arm in docker_targets:
- #@ make_image(version, os, arch, arm)