-
Notifications
You must be signed in to change notification settings - Fork 1
/
.goreleaser.yml
256 lines (238 loc) · 6.76 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
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
---
project_name: crowdstrike-falcon-downloader
dist: ./dist
# https://goreleaser.com/customization/templates/#custom-variables
variables:
MaintainerName: Northwood Labs
MaintainerEmail: [email protected]
Description: |-
CLI/TUI for downloading sensors for CrowdStrike Falcon.
# https://goreleaser.com/customization/reportsizes/
report_sizes: true
# https://goreleaser.com/customization/builds/
builds:
- id: linux
binary: '{{ .ProjectName }}'
skip: false
mod_timestamp: '{{ .CommitTimestamp }}'
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s -w -X github.com/northwood-labs/{{ .ProjectName }}/cmd.Version={{ .Version }}
goos:
- linux
goarch:
- amd64
- arm64
- id: windows
binary: '{{ .ProjectName }}'
skip: false
mod_timestamp: '{{ .CommitTimestamp }}'
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s -w -X github.com/northwood-labs/{{ .ProjectName }}/cmd.Version={{ .Version }}
goos:
- windows
goarch:
- amd64
- arm64
- id: macos
binary: '{{ .ProjectName }}'
skip: false
mod_timestamp: '{{ .CommitTimestamp }}'
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s -w -X github.com/northwood-labs/{{ .ProjectName }}/cmd.Version={{ .Version }}
goos:
- darwin
goarch:
- amd64
- arm64
# https://goreleaser.com/customization/universalbinaries/
universal_binaries:
- id: macos-universal
ids:
- macos
name_template: '{{ .ProjectName }}'
replace: true
# https://goreleaser.com/customization/checksum/
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
# https://goreleaser.com/customization/sign/
signs:
- id: gpg
ids:
- apk
- deb
- linux-archive
- macos-archive
- rpm
- windows-archive
signature: '${artifact}.sig'
artifacts: all
args:
- --batch
- --local-user
- '{{ .Env.GPG_FINGERPRINT }}' # set this environment variable for your signing key
- --output
- ${signature}
- --detach-sign
- ${artifact}
# https://goreleaser.com/customization/release/
release:
github:
owner: northwood-labs
name: '{{ .ProjectName }}'
draft: true
replace_existing_draft: true
replace_existing_artifacts: true
prerelease: auto
make_latest: true
mode: replace
name_template: '{{ .Version }} — {{ time "2006-01-02" }}'
# https://goreleaser.com/customization/changelog/
changelog:
disable: false
use: github-native
# https://goreleaser.com/customization/archive/
archives:
- id: 'linux-archive'
builds:
- linux
allow_different_binary_count: false
wrap_in_directory: false
format: zip
files:
- none*
name_template:
'{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ with .Arm }}32v{{ . }}{{ end }}{{ if not (eq .Amd64
"v1") }}{{ .Amd64 }}{{ end }}'
- id: 'windows-archive'
builds:
- windows
allow_different_binary_count: false
wrap_in_directory: false
format: zip
files:
- none*
name_template:
'{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ with .Arm }}32v{{ . }}{{ end }}{{ if not (eq .Amd64
"v1") }}{{ .Amd64 }}{{ end }}'
- id: 'macos-archive'
builds:
- macos-universal
allow_different_binary_count: false
wrap_in_directory: false
format: zip
files:
- none*
name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-universal'
# https://goreleaser.com/customization/nfpm/
nfpms:
- id: rpm
builds:
- linux
package_name: '{{ .ProjectName }}'
vendor: '{{ .Var.MaintainerName }}'
homepage: 'https://github.com/northwood-labs/{{ .ProjectName }}'
description: '{{.Var.Description}}'
maintainer: '{{ .Var.MaintainerName }} <{{ .Var.MaintainerEmail }}>'
file_name_template: '{{ .ConventionalFileName }}'
umask: 0o002
formats:
- rpm
bindir: /usr/local/bin
epoch: '1'
release: '1'
rpm:
compression: lzma
- id: deb
builds:
- linux
package_name: '{{ .ProjectName }}'
vendor: '{{ .Var.MaintainerName }}'
homepage: 'https://github.com/northwood-labs/{{ .ProjectName }}'
description: '{{.Var.Description}}'
maintainer: '{{ .Var.MaintainerName }} <{{ .Var.MaintainerEmail }}>'
file_name_template: '{{ .ConventionalFileName }}'
umask: 0o002
formats:
- deb
bindir: /usr/local/bin
epoch: '1'
release: '1'
- id: apk
builds:
- linux
package_name: '{{ .ProjectName }}'
vendor: '{{ .Var.MaintainerName }}'
homepage: 'https://github.com/northwood-labs/{{ .ProjectName }}'
description: '{{.Var.Description}}'
maintainer: '{{ .Var.MaintainerName }} <{{ .Var.MaintainerEmail }}>'
file_name_template: '{{ .ConventionalFileName }}'
umask: 0o002
formats:
- apk
bindir: /usr/local/bin
epoch: '1'
release: '1'
# https://goreleaser.com/customization/notarize/
# notarize:
# macos:
# - enabled: '{{ isEnvSet "MACOS_SIGN_P12 }}'
# ids:
# - macos-archive
# sign:
# certificate: '{{ .Env.MACOS_SIGN_P12 }}'
# password: '{{ .Env.MACOS_SIGN_PASSWORD }}'
# notarize:
# issuer_id: '{{ .Env.MACOS_NOTARY_ISSUER_ID }}'
# key_id: '{{ .Env.MACOS_NOTARY_KEY_ID }}'
# key: '{{ .Env.MACOS_NOTARY_KEY }}'
# wait: true
# timeout: 30m
# https://goreleaser.com/customization/homebrew/
brews:
- name: '{{ .ProjectName }}'
# alternative_names:
# - myproject@{{ .Version }}
# - myproject@{{ .Major }}
ids:
- macos-archive
- linux-archive
url_template:
'https://github.com/northwood-labs/{{ .ProjectName }}/releases/download/{{ .Tag }}/{{ .ArtifactName }}'
url_headers:
- 'Accept: application/octet-stream'
- 'Authorization: Bearer #{ENV["HOMEBREW_GITHUB_API_TOKEN"]}'
download_strategy: CurlDownloadStrategy
commit_author:
name: '{{ .Var.MaintainerName }}'
email: '{{ .Var.MaintainerEmail }}'
commit_msg_template: 'automation: Brew formula update for {{ .ProjectName }} version {{ .Tag }}.'
directory: Formula
caveats: 'This is a macOS Universal Binary that should work on Intel and Apple Silicon chips.'
homepage: 'https://github.com/northwood-labs/{{ .ProjectName }}'
description: '{{ .Var.Description }}'
license: Apache-2.0
skip_upload: false
test: |
system "#{bin}/{{ .ProjectName }} version"
repository:
owner: northwood-labs
name: '{{ .ProjectName }}'
branch: main
token: '{{ .Env.GH_PUBLIC_TOKEN }}'
# token_type: 'github'
# git:
# url: '[email protected]:northwood-labs/{{ .ProjectName }}.git'
# private_key: '{{ .Env.PRIVATE_KEY_PATH }}'