-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
216 lines (200 loc) · 6.51 KB
/
.goreleaser.yaml
File metadata and controls
216 lines (200 loc) · 6.51 KB
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
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
project_name: tiger-cli
# Create VERSION file and generate completions before building
before:
hooks:
- sh -c 'echo "{{ .Tag }}" > latest.txt'
- ./scripts/completions.sh
builds:
- main: ./cmd/tiger
binary: tiger
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- 386
- amd64
- arm64
ldflags:
- -s -w
- -X github.com/timescale/tiger-cli/internal/tiger/config.Version={{.Version}}
- -X github.com/timescale/tiger-cli/internal/tiger/config.BuildTime={{.Date}}
- -X github.com/timescale/tiger-cli/internal/tiger/config.GitCommit={{.Commit}}
archives:
- id: archive
formats: [tar.gz]
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
files:
- README.md
- LICENSE
- NOTICE
- completions/*
# Linux package configuration (APT, RPM, etc.)
nfpms:
- id: packages
package_name: tiger-cli
vendor: Timescale, Inc., d/b/a Tiger Data
homepage: https://github.com/timescale/tiger-cli
maintainer: Tiger Data <support@tigerdata.com>
description: |-
Tiger CLI - Tiger Cloud Platform CLI
Command-line interface for managing Tiger Cloud platform resources
license: Apache-2.0
formats:
- deb
- rpm
bindir: /usr/bin
priority: extra
file_name_template: "{{ .ConventionalFileName }}"
contents:
# Shell completions
- src: ./completions/tiger.bash
dst: /usr/share/bash-completion/completions/tiger
file_info:
mode: 0644
mtime: "{{ .CommitDate }}"
- src: ./completions/tiger.fish
dst: /usr/share/fish/vendor_completions.d/tiger.fish
file_info:
mode: 0644
mtime: "{{ .CommitDate }}"
- src: ./completions/tiger.zsh
dst: /usr/share/zsh/vendor-completions/_tiger
file_info:
mode: 0644
mtime: "{{ .CommitDate }}"
rpm:
group: Unspecified
deb:
lintian_overrides:
- statically-linked-binary
dockers_v2:
- id: docker
images:
- ghcr.io/timescale/tiger-cli
tags:
- "{{ .Version }}"
- '{{ if eq .Prerelease "" }}{{ .Major }}{{ end }}'
- '{{ if eq .Prerelease "" }}{{ .Major }}.{{ .Minor }}{{ end }}'
- '{{ if eq .Prerelease "" }}latest{{ end }}'
labels:
org.opencontainers.image.created: "{{.Date}}"
org.opencontainers.image.name: "{{.ProjectName}}"
org.opencontainers.image.title: "{{.ProjectName}}"
org.opencontainers.image.revision: "{{.FullCommit}}"
org.opencontainers.image.source: "https://github.com/timescale/tiger-cli"
org.opencontainers.image.url: "https://github.com/timescale/tiger-cli"
org.opencontainers.image.version: "{{.Version}}"
io.modelcontextprotocol.server.name: "io.github.timescale/tiger-cli"
build_args:
BINARY_SOURCE: release
platforms:
- linux/amd64
- linux/arm64
# S3 Blob Storage Configuration
blobs:
# Versioned release artifacts
- provider: s3
bucket: tiger-cli-releases
region: us-east-1
directory: "releases/{{ .Tag }}"
ids:
- archive # Archive ID
- packages # nfpms package ID
# Upload install script and latest version file to bucket root (skip for prereleases)
- provider: s3
bucket: tiger-cli-releases
region: us-east-1
directory: "{{ \"\" }}" # Can't use an empty string directly or GoReleaser defaults to "{{ .ProjectName }}/{{ .Tag }}"
extra_files_only: true
disable: '{{ ne .Prerelease "" }}' # Skip this step for prereleases
extra_files:
- glob: ./latest.txt
name_template: "latest.txt"
- glob: ./scripts/install.sh
name_template: "install.sh"
- glob: ./scripts/install.ps1
name_template: "install.ps1"
# Homebrew cask configuration
homebrew_casks:
- name: tiger-cli
repository:
owner: timescale
name: homebrew-tap
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
homepage: https://github.com/timescale/tiger-cli
description: |-
Tiger CLI - Tiger Cloud Platform CLI
Command-line interface for managing Tiger Cloud platform resources
binaries: [ tiger ]
license: Apache-2.0
skip_upload: auto # Skips prerelease builds
url:
template: "https://cli.tigerdata.com/releases/{{ .Tag }}/{{ .ArtifactName }}"
hooks:
# TODO: Sign and notarize instead of removing quarantine bit
# See: https://goreleaser.com/customization/homebrew_casks/#signing-and-notarizing
post:
install: |
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/tiger"]
end
# Shell completions
completions:
bash: "completions/tiger.bash"
zsh: "completions/tiger.zsh"
fish: "completions/tiger.fish"
# NOTE: There is a bug in GoReleaser when caveats contain normal multiline
# strings, which causes the homebrew cask to only output the final line.
# Formatting it in the following way works around it.
caveats: >
Tiger CLI has been installed successfully!\n\nGet started with:\n tiger auth login\n tiger mcp install\n\nFor help:\n tiger help
# Checksum configuration - split into individual files for easier validation
checksum:
split: true
changelog:
sort: asc
filters:
exclude:
- "^specs:"
# TODO: Other files that should be ignored
# Publishers for external registries
publishers:
# Upload all Linux packages (deb, rpm) to PackageCloud
- name: packagecloud
disable: '{{ ne .Prerelease "" }}' # Skip this step for prereleases
ids:
- packages # Only publish nfpms packages (Linux packages)
cmd: >-
package_cloud push timescale/tiger-cli/{{-
if contains .ArtifactPath ".deb" -}}
any/any
{{- else if contains .ArtifactPath ".rpm" -}}
rpm_any/rpm_any
{{- end }} {{ .ArtifactPath }}
env:
- PACKAGECLOUD_TOKEN={{ .Env.PACKAGECLOUD_TOKEN }}
# Release configuration
release:
github:
owner: timescale
name: tiger-cli
draft: false
prerelease: auto
name_template: "Release {{ .Tag }}"