-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.goreleaser.yaml
228 lines (199 loc) · 7.88 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
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
version: 2
builds:
- id: linux
goos:
- linux
ldflags:
- -linkmode 'external' -extldflags '-static'
- -X "github.com/otterize/otterize-cli/src/cmd/version.Commit={{ .Commit }}"
- -X "github.com/otterize/otterize-cli/src/cmd/version.Version={{ .Tag }}"
main:
./src/cmd
ignore:
- goos: linux
goarch: "386"
- goos: linux
goarch: arm64
hooks:
post:
- output: true
# checks that we've successfully statically built this executable
cmd: /bin/sh -c "ldd {{ .Path }} 2>&1 | grep 'not a dynamic executable'"
binary: otterize
- id: windows
goos:
- windows
ldflags:
- -linkmode 'external' -extldflags '-static'
- -X "github.com/otterize/otterize-cli/src/cmd/version.Commit={{ .Commit }}"
- -X "github.com/otterize/otterize-cli/src/cmd/version.Version={{ .Tag }}"
main:
./src/cmd
ignore:
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: windows
goarch: "386"
hooks:
post:
- output: true
# checks that we've successfully statically built this executable
cmd: |
ldd {{ .Path }} 2>&1;
if ldd {{ .Path }} 2>&1 | grep -v 'ntdll.dll' | grep -v 'KERNEL32.DLL' | grep -v 'KERNELBASE.dll' | grep -v 'apphelp.dll' | grep -v 'msvcrt.dll'; then echo "Found unexpected DLL, terminating build" && exit 1; fi
binary: otterize
- id: macos-amd
goos:
- darwin
ldflags:
- -X "github.com/otterize/otterize-cli/src/cmd/version.Commit={{ .Commit }}"
- -X "github.com/otterize/otterize-cli/src/cmd/version.Version={{ .Tag }}"
goarch:
- amd64
main:
./src/cmd
# intentionally no static linking for macOS - from the man page for `gcc` on `-static`:
# This option will not work on Mac OS X unless all libraries (including libgcc.a) have also been compiled with -static. Since neither a static version of libSystem.dylib nor crt0.o are provided, this option is not useful to most people.
binary: otterize
hooks:
post:
- output: true
cmd: 'codesign --timestamp --options=runtime -s "Developer ID Application: Otterize, Inc." -v {{ .Path }}'
- output: true
cmd: zip -j "{{ .Path }}_macOS_amd64_notarized.zip" "{{ .Path }}"
- output: true
cmd: xcrun notarytool submit "{{ .Path }}_macOS_amd64_notarized.zip" --apple-id "ori@otterize.com" --team-id "3X6Z7976XD" --password "{{ .Env.AC_PASSWORD }}" --wait
- id: macos-arm
goos:
- darwin
ldflags:
- -X "github.com/otterize/otterize-cli/src/cmd/version.Commit={{ .Commit }}"
- -X "github.com/otterize/otterize-cli/src/cmd/version.Version={{ .Tag }}"
goarch:
- arm64
main:
./src/cmd
# intentionally no static linking for macOS - from the man page for `gcc` on `-static`:
# This option will not work on Mac OS X unless all libraries (including libgcc.a) have also been compiled with -static. Since neither a static version of libSystem.dylib nor crt0.o are provided, this option is not useful to most people.
binary: otterize
hooks:
post:
- output: true
cmd: 'codesign --timestamp --options=runtime -s "Developer ID Application: Otterize, Inc." -v {{ .Path }}'
- output: true
cmd: zip -j "{{ .Path }}_macOS_arm64_notarized.zip" "{{ .Path }}"
- output: true
cmd: xcrun notarytool submit "{{ .Path }}_macOS_arm64_notarized.zip" --apple-id "ori@otterize.com" --team-id "3X6Z7976XD" --password "{{ .Env.AC_PASSWORD }}" --wait
# no upx for mac arm - causes invalid instructions
archives:
- id: binary
name_template: "{{ .ProjectName }}_{{ .Os }}_{{- if eq .Arch \"amd64\" }}x86_64
{{- else if eq .Arch \"386\" }}i386
{{- else }}{{ .Arch }}{{ end }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 \"v1\") }}{{ .Amd64 }}{{ end }}"
format: binary
files:
- none* # binary only
- id: archives
name_template: "{{ .Binary }}_{{ .Os }}_ {{- if eq .Arch \"amd64\" }}x86_64
{{- else if eq .Arch \"386\" }}i386
{{- else }}{{ .Arch }}{{ end }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 \"v1\") }}{{ .Amd64 }}{{ end }}"
format: tar.gz
format_overrides:
- goos: windows
format: zip
- goos: darwin
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
release:
extra_files:
- glob: dist/darwin/macos-amd_darwin_amd64_v1/otterize*
- glob: dist/darwin/macos-arm_darwin_arm64/otterize*
brews:
- name: otterize-cli
ids:
- archives
# NOTE: make sure the url_template, the token and given repo (github or gitlab) owner and name are from the
# same kind. We will probably unify this in the next major version like it is done with scoop.
# GitHub/GitLab repository to push the formula to
# Gitea is not supported yet, but the support coming
repository:
owner: otterize
name: homebrew-otterize
url_template: "https://get.otterize.com/{{ .ProjectName }}/{{ .Tag }}/{{ .ArtifactName }}"
# Git author used to commit to the repository.
# Defaults are shown.
commit_author:
name: otterizebot
email: otterizebot@users.noreply.github.com
# Folder inside the repository to put the formula.
# Default is the root folder.
directory: Formula
# Your app's homepage.
# Default is empty.
homepage: "https://github.com/otterize/otterize-cli"
description: "Otterize CLI"
# SPDX identifier of your app's license.
# Default is empty.
license: "Apache-2.0"
scoops:
# You can have multiple scoop configs
-
# Template for the url which is determined by the given Token (github or gitlab)
# Default for github is "https://github.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
# Default for gitlab is "https://gitlab.com/<repo_owner>/<repo_name>/-/releases/{{ .Tag }}/downloads/{{ .ArtifactName }}"
# Default for gitea is "https://gitea.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
url_template: "https://get.otterize.com/{{ .ProjectName }}/{{ .Tag }}/{{ .ArtifactName }}"
name: otterize-cli
# Repository to push the app manifest to.
repository:
owner: otterize
name: scoop-otterize-cli
# Optionally a branch can be provided.
# Defaults to the default repository branch.
branch: main
# Git author used to commit to the repository.
# Defaults are shown.
commit_author:
name: otterizebot
email: otterizebot@users.noreply.github.com
# The project name and current git tag are used in the format string.
commit_msg_template: "Scoop update for {{ .ProjectName }} version {{ .Tag }}"
# Your app's homepage.
# Default is empty.
homepage: "https://github.com/otterize/otterize-cli"
# Your app's description.
# Default is empty.
description: "Otterize CLI"
# Your app's license
# Default is empty.
license: "Apache-2.0"
blobs:
# You can have multiple blob configs
-
# Template for the cloud provider name
# s3 for AWS S3 Storage
# azblob for Azure Blob Storage
# gs for Google Cloud Storage
provider: gs
# Template for the bucket name
bucket: get.otterize.com
# IDs of the artifacts you want to upload.
ids:
- binary
- archives
extra_files:
- glob: dist/darwin/macos-amd_darwin_amd64_v1/otterize*
- glob: dist/darwin/macos-arm_darwin_arm64/otterize*