1# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
  2# vim: set ts=2 sw=2 tw=0 fo=jcroql
  3version: 2
  4
  5project_name: crush
  6
  7includes:
  8  - from_url:
  9      url: charmbracelet/meta/main/notarize.yaml
 10
 11metadata:
 12  mod_timestamp: "{{ .CommitTimestamp }}"
 13  license: "FSL-1.1-MIT"
 14  homepage: "https://charm.sh/crush"
 15  description: "A powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal."
 16  full_description: "A powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal."
 17  maintainers:
 18    - "kujtimiihoxha <kujtim@charm.sh>"
 19    - "caarlos0 <carlos@charm.sh>" # for aur
 20
 21nightly:
 22  publish_release: true
 23  keep_single_release: true
 24  version_template: "{{ incminor .Version }}-nightly"
 25
 26snapshot:
 27  version_template: "0.0.0-{{ .Timestamp }}"
 28
 29before:
 30  hooks:
 31    - go mod tidy
 32    - rm -rf completions
 33    - mkdir completions
 34    - rm -rf manpages
 35    - mkdir manpages
 36    - sh -c 'go run . completion bash >./completions/crush.bash'
 37    - sh -c 'go run . completion zsh >./completions/crush.zsh'
 38    - sh -c 'go run . completion fish >./completions/crush.fish'
 39    - sh -c 'go run . man | gzip -c >./manpages/crush.1.gz'
 40
 41# gomod:
 42#   proxy: true
 43
 44builds:
 45  - env:
 46      - CGO_ENABLED=0
 47      - GOEXPERIMENT=greenteagc
 48    goos:
 49      - linux
 50      - darwin
 51      - windows
 52      - freebsd
 53      - openbsd
 54      - netbsd
 55      - android
 56    goarch:
 57      - amd64
 58      - arm64
 59      - "386"
 60      - arm
 61    goarm:
 62      - "7"
 63    ignore:
 64      - goos: android
 65        goarch: amd64
 66      - goos: android
 67        goarch: arm
 68      - goos: android
 69        goarch: "386"
 70      - goos: windows
 71        goarch: arm
 72    ldflags:
 73      - -s -w -X github.com/charmbracelet/crush/internal/version.Version={{.Version}}
 74    flags:
 75      - -trimpath
 76
 77archives:
 78  - name_template: >-
 79      crush_
 80      {{- .Version }}_
 81      {{- title .Os }}_
 82      {{- if eq .Arch "amd64" }}x86_64
 83      {{- else if eq .Arch "386" }}i386
 84      {{- else }}{{ .Arch }}{{ end }}
 85      {{- with .Arm}}v{{ . }}{{ end }}
 86    wrap_in_directory: true
 87    files:
 88      - README*
 89      - LICENSE*
 90      - manpages/*
 91      - completions/*
 92    format_overrides:
 93      - goos: windows
 94        formats: [zip]
 95
 96checksum:
 97  name_template: "checksums.txt"
 98
 99aur_sources:
100  - private_key: "{{ .Env.AUR_KEY }}"
101    disable: "{{ with .Prerelease }}true{{ end }}"
102    git_url: "ssh://aur@aur.archlinux.org/crush.git"
103    commit_author:
104      name: "Charm"
105      email: "charmcli@users.noreply.github.com"
106    makedepends:
107      - go
108      - git
109    prepare: |-
110      go mod download
111    build: |-
112      mkdir completions
113      mkdir manpages
114      export CGO_CPPFLAGS="${CPPFLAGS}"
115      export CGO_CFLAGS="${CFLAGS}"
116      export CGO_CXXFLAGS="${CXXFLAGS}"
117      export CGO_LDFLAGS="${LDFLAGS}"
118      export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
119      go build -ldflags="-w -s -buildid='' -linkmode=external -X main.version=v${pkgver}" .
120      ./crush completion bash >./completions/crush.bash
121      ./crush completion zsh >./completions/crush.zsh
122      ./crush completion fish >./completions/crush.fish
123      ./crush man | gzip -c >./manpages/crush.1.gz
124    package: |-
125      # bin
126      install -Dm755 "./crush" "${pkgdir}/usr/bin/crush"
127      # license
128      mkdir -p "${pkgdir}/usr/share/licenses/crush/"
129      install -Dm644 ./LICENSE* "${pkgdir}/usr/share/licenses/crush/"
130      # completions
131      mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
132      mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
133      mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
134      install -Dm644 "./completions/crush.bash" "${pkgdir}/usr/share/bash-completion/completions/crush"
135      install -Dm644 "./completions/crush.zsh" "${pkgdir}/usr/share/zsh/site-functions/_crush"
136      install -Dm644 "./completions/crush.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/crush.fish"
137      # man pages
138      install -Dm644 "./manpages/crush.1.gz" "${pkgdir}/usr/share/man/man1/crush.1.gz"
139      # readme
140      mkdir -pv "${pkgdir}/usr/share/doc/crush/"
141      install -Dm644 README* "${pkgdir}/usr/share/doc/crush/"
142
143aurs:
144  - private_key: "{{ .Env.AUR_KEY }}"
145    disable: "{{ with .Prerelease }}true{{ end }}"
146    git_url: "ssh://aur@aur.archlinux.org/crush-bin.git"
147    commit_author:
148      name: "Charm"
149      email: "charmcli@users.noreply.github.com"
150    provides:
151      - crush
152    conflicts:
153      - crush
154    package: |-
155      cd "${srcdir}/crush_${pkgver}_Linux_${CARCH}"
156      # bin
157      install -Dm755 "./crush" "${pkgdir}/usr/bin/crush"
158      # license
159      mkdir -p "${pkgdir}/usr/share/licenses/crush/"
160      install -Dm644 ./LICENSE* "${pkgdir}/usr/share/licenses/crush/"
161      # completions
162      mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
163      mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
164      mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
165      install -Dm644 "./completions/crush.bash" "${pkgdir}/usr/share/bash-completion/completions/crush"
166      install -Dm644 "./completions/crush.zsh" "${pkgdir}/usr/share/zsh/site-functions/_crush"
167      install -Dm644 "./completions/crush.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/crush.fish"
168      # man pages
169      install -Dm644 "./manpages/crush.1.gz" "${pkgdir}/usr/share/man/man1/crush.1.gz"
170      # readme
171      mkdir -pv "${pkgdir}/usr/share/doc/crush/"
172      install -Dm644 README* "${pkgdir}/usr/share/doc/crush/"
173
174furies:
175  - disable: "{{ if (or .Prerelease .IsNightly) }}true{{ end }}"
176    account: "{{ with .Env.FURY_TOKEN }}charmcli{{ else }}{{ end }}"
177    secret_name: FURY_TOKEN
178
179brews:
180  - repository:
181      owner: charmbracelet
182      name: homebrew-tap
183      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
184    skip_upload: "{{ with .Prerelease }}true{{ end }}"
185    commit_author:
186      name: "Charm"
187      email: "charmcli@users.noreply.github.com"
188    goarm: 7
189    extra_install: |-
190      bash_completion.install "completions/{{ .ProjectName }}.bash" => "{{ .ProjectName }}"
191      zsh_completion.install "completions/{{ .ProjectName }}.zsh" => "_{{ .ProjectName }}"
192      fish_completion.install "completions/{{ .ProjectName }}.fish"
193      man1.install "manpages/{{ .ProjectName }}.1.gz"
194
195scoops:
196  - repository:
197      owner: charmbracelet
198      name: scoop-bucket
199      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
200    skip_upload: "{{ with .Prerelease }}true{{ end }}"
201    commit_author:
202      name: "Charm"
203      email: "charmcli@users.noreply.github.com"
204
205npms:
206  - name: "@charmland/crush"
207    repository: "git+https://github.com/charmbracelet/crush.git"
208    bugs: https://github.com/charmbracelet/crush/issues
209    access: public
210    disable: "{{ with .Prerelease }}true{{ end }}"
211
212nfpms:
213  - formats:
214      - apk
215      - deb
216      - rpm
217      - archlinux
218      - termux.deb
219    file_name_template: "{{ .ConventionalFileName }}"
220    contents:
221      - src: ./completions/crush.bash
222        dst: '{{ if eq .Format "termux.deb" }}/data/data/com.termux/files/usr{{ end }}/etc/bash_completion.d/crush'
223      - src: ./completions/crush.fish
224        dst: '{{ if eq .Format "termux.deb" }}/data/data/com.termux/files{{ end }}/usr/share/fish/vendor_completions.d/crush.fish'
225      - src: ./completions/crush.zsh
226        dst: '{{ if eq .Format "termux.deb" }}/data/data/com.termux/files{{ end }}/usr/share/zsh/site-functions/_crush'
227      - src: ./manpages/crush.1.gz
228        dst: '{{ if eq .Format "termux.deb" }}/data/data/com.termux/files{{ end }}/usr/share/man/man1/crush.1.gz'
229    rpm:
230      signature:
231        key_file: '{{ if ne (index .Env "GPG_KEY_PATH") "" }}{{ .Env.GPG_KEY_PATH }}{{ else }}{{ end }}'
232    deb:
233      signature:
234        key_file: '{{ if ne (index .Env "GPG_KEY_PATH") "" }}{{ .Env.GPG_KEY_PATH }}{{ else }}{{ end }}'
235
236signs:
237  - cmd: cosign
238    certificate: "${artifact}.pem"
239    args:
240      - sign-blob
241      - "--output-certificate=${certificate}"
242      - "--output-signature=${signature}"
243      - "${artifact}"
244      - "--yes"
245    artifacts: checksum
246    output: true
247
248source:
249  enabled: true
250
251sboms:
252  - artifacts: archive
253  - id: source
254    artifacts: source
255
256nix:
257  - repository:
258      owner: "charmbracelet"
259      name: nur
260      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
261    commit_author:
262      name: "Charm"
263      email: "charmcli@users.noreply.github.com"
264    license: fsl11Mit
265    skip_upload: "{{ with .Prerelease }}true{{ end }}"
266    extra_install: |-
267      installManPage ./manpages/crush.1.gz
268      installShellCompletion ./completions/*
269
270winget:
271  - publisher: charmbracelet
272    copyright: Charmbracelet, Inc
273    publisher_url: https://charm.land
274    release_notes_url: "https://github.com/charmbracelet/crush/releases/tag/{{.Tag}}"
275    license_url: https://github.com/charmbracelet/crush/blob/main/LICENSE.md
276    skip_upload: "{{ with .Prerelease }}true{{ end }}"
277    commit_author:
278      name: "Charm"
279      email: "charmcli@users.noreply.github.com"
280    repository:
281      owner: "charmbracelet"
282      name: winget-pkgs
283      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
284      branch: "crush-{{.Version}}"
285      pull_request:
286        enabled: true
287        draft: false
288        check_boxes: true
289        base:
290          owner: microsoft
291          name: winget-pkgs
292          branch: master
293
294changelog:
295  sort: asc
296  disable: "{{ .IsNightly }}"
297  use: github
298  filters:
299    exclude:
300      - "^(build|ci): "
301      - "^chore: auto-update generated files$"
302      - "^chore: docs$"
303      - "^chore: schema update$"
304      - "^chore: schema$"
305      - "^chore: typo$"
306      - "^chore: update schema$"
307      - "^chore: update$"
308      - "^chore\\(legal\\): "
309      - "^chore\\(deps\\): "
310      - "^docs: update$"
311      - "^test:"
312      - "^test\\("
313      - "^v\\d.*"
314      - "merge conflict"
315      - "merge conflict"
316      - Merge branch
317      - Merge pull request
318      - Merge remote-tracking branch
319      - go mod tidy
320      - "^wip "
321      - "^wip:"
322  groups:
323    - title: "Deps"
324      regexp: "^.*\\(deps\\)*:+.*$"
325      order: 300
326    - title: "New!"
327      regexp: "^.*feat[(\\w)]*:+.*$"
328      order: 100
329    - title: "Fixed"
330      regexp: "^.*fix[(\\w)]*:+.*$"
331      order: 200
332    - title: "Docs"
333      regexp: "^.*docs[(\\w)]*:+.*$"
334      order: 400
335    - title: "Other stuff"
336      order: 9999
337
338release:
339  prerelease: auto
340  footer:
341    from_url:
342      url: https://raw.githubusercontent.com/charmbracelet/meta/main/footer.md