-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.goreleaser.yaml
203 lines (184 loc) · 5.27 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
env:
- CGO_ENABLED=1
- COSIGN_YES=true
before:
hooks:
- go mod tidy
- go mod verify
builds:
- id: "darwin-amd64"
binary: "{{ .ProjectName }}"
main: ./cmd/{{ .ProjectName }}
goarch:
- amd64
goos:
- darwin
env:
- CC=o64-clang
- CXX=o64-clang++
flags:
- -trimpath
- -pgo={{ .Env.PGO_FILE }}
ldflags:
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}
- id: "darwin-arm64"
binary: "{{ .ProjectName }}"
main: ./cmd/{{ .ProjectName }}
goarch:
- arm64
goos:
- darwin
env:
- CC=oa64-clang
- CXX=oa64-clang++
flags:
- -trimpath
- -pgo={{ .Env.PGO_FILE }}
ldflags:
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}
- id: "linux-amd64"
binary: "{{ .ProjectName }}"
main: ./cmd/{{ .ProjectName }}
env:
- CC=x86_64-linux-gnu-gcc
- CXX=x86_64-linux-gnu-g++
goarch:
- amd64
goos:
- linux
flags:
- -trimpath
- -pgo={{ .Env.PGO_FILE }}
ldflags:
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}
- id: "linux-arm64"
binary: "{{ .ProjectName }}"
main: ./cmd/{{ .ProjectName }}
goarch:
- arm64
goos:
- linux
env:
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
flags:
- -trimpath
- -pgo={{ .Env.PGO_FILE }}
ldflags:
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}
- id: "windows-amd64"
binary: "{{ .ProjectName }}"
main: ./cmd/{{ .ProjectName }}
goarch:
- amd64
goos:
- windows
env:
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
flags:
- -trimpath
- -pgo={{ .Env.PGO_FILE }}
- -buildmode=exe
ldflags:
- -s -w -X github.com/teler-sh/{{ .ProjectName }}/common.Version={{ .Version }}
archives:
- id: build
builds:
- "darwin-amd64"
- "darwin-arm64"
- "linux-amd64"
- "linux-arm64"
- "windows-amd64"
name_template: >-
{{- .ProjectName }}_{{- .Tag }}-
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
format: binary
signs:
- cmd: cosign
stdin: "{{ .Env.COSIGN_PASSWORD }}"
args:
- "sign-blob"
- "--key"
- "{{ .Env.COSIGN_KEY_PREFIX }}.key"
- "--output-signature"
- "${signature}"
- "${artifact}"
artifacts: binary
sboms:
- artifacts: binary
documents:
- >-
{{- .ProjectName }}_{{- .Tag }}-
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}.sbom
checksum:
name_template: "checksums-{{ .ProjectName }}_{{ .Tag }}.txt"
snapshot:
name_template: "{{ .Tag }}-{{ .ShortCommit }}"
dockers:
- image_templates:
- "ghcr.io/teler-sh/{{ .ProjectName }}:{{ .Tag }}"
- "ghcr.io/teler-sh/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}"
- "ghcr.io/teler-sh/{{ .ProjectName }}:v{{ .Major }}"
- "ghcr.io/teler-sh/{{ .ProjectName }}:latest"
dockerfile: Dockerfile.goreleaser
use: docker
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.authors=\"Dwi Siswanto <[email protected]>\""
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.description=\"teler Proxy enabling seamless integration with teler WAF to protect locally running web service against a variety of web-based attacks\""
- "--label=org.opencontainers.image.licenses=Apache-2.0"
- "--label=org.opencontainers.image.ref.name={{ .Tag }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.url=https://github.com/teler-sh/{{ .ProjectName }}"
- "--label=org.opencontainers.image.version={{ .Version }}"
docker_signs:
- cmd: cosign
stdin: "{{ .Env.COSIGN_PASSWORD }}"
args:
- "sign"
- "--key"
- "{{ .Env.COSIGN_KEY_PREFIX }}.key"
- "--upload=false"
- "${artifact}"
artifacts: images
output: true
changelog:
sort: asc
filters:
exclude:
- "^build"
- "^chore"
- "^ci"
- "^docs"
- "^refactor"
- "^test"
- Merge pull request
- Merge branch
release:
draft: true
prerelease: auto
footer: |
## Verify
> [!IMPORTANT]
> It is strongly recommended to verify the integrity and security of the release assets before executing them. This helps mitigate potential risks associated with running unverified files.
First, verify the file using checksums.
```bash
sha256sum --check --ignore-missing checksums-{{ .ProjectName }}_{{ .Tag }}.txt
```
Then, ensure the authenticity of the release asset with [Cosign](https://github.com/sigstore/cosign):
```bash
cosign verify-blob --key release-{{ .ProjectName }}_{{ .Tag }}.pub --signature {{ .ProjectName }}_{{ .Tag }}-OS_ARCH.sig {{ .ProjectName }}_{{ .Tag }}-OS_ARCH
```
name_template: "{{ .Tag }}"
extra_files:
- glob: "{{ .Env.COSIGN_KEY_PREFIX }}.pub"
- glob: "teler-waf.conf.example.*"