-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.goreleaser.yaml
More file actions
274 lines (238 loc) · 7.22 KB
/
.goreleaser.yaml
File metadata and controls
274 lines (238 loc) · 7.22 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
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
version: 2
before:
hooks:
- go mod tidy
- go test ./...
- ./scripts/completions.sh
builds:
- id: tokenizer
main: ./cmd/tokenizer
binary: tokenizer
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
- freebsd
goarch:
- amd64
- arm64
- arm
goarm:
- "6"
- "7"
ignore:
- goos: darwin
goarch: arm
- goos: windows
goarch: arm
- goos: windows
goarch: arm64
- goos: freebsd
goarch: arm
# Set module timestamp for reproducible builds
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- -s -w
- -X main.version={{.Version}}
- -X main.commit={{.ShortCommit}}
- -X main.buildDate={{.Date}}
- -X main.goVersion={{.Env.GO_VERSION}}
- -X main.builtBy=goreleaser
archives:
- id: tokenizer
ids:
- tokenizer
formats:
- tar.gz
format_overrides:
- goos: windows
formats:
- zip
name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
files:
- LICENSE
- README.md
- completions/*
checksum:
name_template: 'checksums.txt'
algorithm: sha256
# Software Bill of Materials generation
sboms:
- artifacts: archive
documents:
- "${artifact}.sbom.json"
snapshot:
version_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
use: github
filters:
exclude:
- '^docs:'
- '^test:'
- '^chore:'
- Merge pull request
- Merge branch
groups:
- title: 'New Features'
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
order: 0
- title: 'Bug fixes'
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
order: 1
- title: 'Performance improvements'
regexp: '^.*?perf(\([[:word:]]+\))??!?:.+$'
order: 2
- title: Others
order: 999
release:
github:
owner: agentstation
name: tokenizer
name_template: "v{{.Version}}"
footer: |
### Checksums
```
{{ .Checksums }}
```
header: |
## Release v{{.Version}}
### Installation
#### Homebrew (macOS and Linux)
```bash
brew install agentstation/tap/tokenizer
```
#### Docker
```bash
docker run --rm -it ghcr.io/agentstation/tokenizer:{{.Version}} llama3 encode "Hello, world!"
```
#### Download Binary
Download the appropriate binary for your platform from the assets below.
#### Using Go
```bash
go install github.com/agentstation/tokenizer/cmd/tokenizer@v{{.Version}}
```
#### Verify Checksums
```bash
# Download checksums.txt and the binary, then:
sha256sum -c checksums.txt
```
### Shell Completions
Generate shell completions for your shell:
```bash
# Bash
tokenizer completion bash > /etc/bash_completion.d/tokenizer
# Zsh
tokenizer completion zsh > "${fpath[1]}/_tokenizer"
# Fish
tokenizer completion fish > ~/.config/fish/completions/tokenizer.fish
```
# Homebrew cask configuration (new approach for pre-built binaries)
homebrew_casks:
- repository:
owner: agentstation
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
# Cask name
name: tokenizer
# Directory inside the repository (default is Casks)
directory: Casks
# Git commit information
commit_author:
name: "GitHub Actions"
email: "actions@github.com"
commit_msg_template: "Update tokenizer to {{ .Tag }}"
# Homepage
homepage: "https://github.com/agentstation/tokenizer"
# Description
description: "High-performance tokenizer implementations in Go with unified CLI"
# License
license: "MIT"
# Binary name (extracted from archive)
binary: tokenizer
# Post-install hook for unsigned binaries (macOS)
hooks:
post:
install: |
if system_command("/usr/bin/xattr", args: ["-h"]).exit_status == 0
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/tokenizer"], sudo: false
end
# Shell completions (files included in the archive)
completions:
bash: completions/tokenizer.bash
zsh: completions/tokenizer.zsh
fish: completions/tokenizer.fish
# Custom caveats
caveats: |
Tokenizer has been installed! 🚀
Quick start:
tokenizer llama3 encode 'Hello, world!' # Encode text to tokens
tokenizer llama3 decode 128000 9906 128001 # Decode tokens to text
tokenizer llama3 info # Show tokenizer info
tokenizer --help # Show all commands
Shell completions have been installed to:
Bash: #{HOMEBREW_PREFIX}/etc/bash_completion.d
Zsh: #{HOMEBREW_PREFIX}/share/zsh/site-functions
Fish: #{HOMEBREW_PREFIX}/share/fish/vendor_completions.d
Documentation: https://github.com/agentstation/tokenizer
# Docker image configuration
dockers:
- id: tokenizer-amd64
ids:
- tokenizer
goos: linux
goarch: amd64
image_templates:
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-amd64"
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source=https://github.com/agentstation/tokenizer"
- "--label=org.opencontainers.image.description=High-performance tokenizer implementations in Go with unified CLI"
- "--label=org.opencontainers.image.licenses=MIT"
- "--platform=linux/amd64"
- id: tokenizer-arm64
ids:
- tokenizer
goos: linux
goarch: arm64
image_templates:
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-arm64"
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source=https://github.com/agentstation/tokenizer"
- "--label=org.opencontainers.image.description=High-performance tokenizer implementations in Go with unified CLI"
- "--label=org.opencontainers.image.licenses=MIT"
- "--platform=linux/arm64"
# Docker manifest for multi-arch support
docker_manifests:
- name_template: "ghcr.io/agentstation/tokenizer:{{ .Tag }}"
image_templates:
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-amd64"
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-arm64"
- name_template: "ghcr.io/agentstation/tokenizer:latest"
image_templates:
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-amd64"
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-arm64"