.goreleaser.yml

  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  maintainers:
 17    - "kujtimiihoxha <kujtim@charm.sh>"
 18
 19nightly:
 20  publish_release: true
 21  keep_single_release: true
 22  version_template: "{{ incminor .Version }}-nightly"
 23
 24snapshot:
 25  version_template: "0.0.0-{{ .Timestamp }}"
 26
 27before:
 28  hooks:
 29    - go mod tidy
 30    - rm -rf completions
 31    - mkdir completions
 32    - rm -rf manpages
 33    - mkdir manpages
 34    - sh -c 'go run . completion bash >./completions/crush.bash'
 35    - sh -c 'go run . completion zsh >./completions/crush.zsh'
 36    - sh -c 'go run . completion fish >./completions/crush.fish'
 37    - sh -c 'go run . man | gzip -c >./manpages/crush.1.gz'
 38
 39# gomod:
 40#   proxy: true
 41
 42builds:
 43  - env:
 44      - CGO_ENABLED=0
 45    goos:
 46      - linux
 47      - darwin
 48      - windows
 49      - freebsd
 50      - openbsd
 51      - netbsd
 52    goarch:
 53      - amd64
 54      - arm64
 55      - "386"
 56      - arm
 57    goarm:
 58      - "7"
 59
 60    ldflags:
 61      - -s -w -X github.com/charmbracelet/crush/internal/version.Version={{.Version}}
 62
 63archives:
 64  - name_template: >-
 65      crush_
 66      {{- .Version }}_
 67      {{- title .Os }}_
 68      {{- if eq .Arch "amd64" }}x86_64
 69      {{- else if eq .Arch "386" }}i386
 70      {{- else }}{{ .Arch }}{{ end }}
 71      {{- with .Arm}}v{{ . }}{{ end }}
 72    wrap_in_directory: true
 73    files:
 74      - README*
 75      - LICENSE*
 76      - manpages/*
 77      - completions/*
 78    format_overrides:
 79      - goos: windows
 80        formats: [zip]
 81
 82checksum:
 83  name_template: "checksums.txt"
 84
 85aurs:
 86  - private_key: "{{ .Env.AUR_KEY }}"
 87    git_url: "ssh://aur@aur.archlinux.org/crush-bin.git"
 88    provides:
 89      - crush
 90    conflicts:
 91      - crush
 92    package: |-
 93      cd "${srcdir}/crush_${pkgver}_Linux_${CARCH}"
 94      # bin
 95      install -Dm755 "./crush" "${pkgdir}/usr/bin/crush"
 96      # license
 97      mkdir -p "${pkgdir}/usr/share/licenses/crush/"
 98      install -Dm644 ./LICENSE* "${pkgdir}/usr/share/licenses/crush/"
 99      # completions
100      mkdir -p "${pkgdir}/usr/share/bash-completion/completions/"
101      mkdir -p "${pkgdir}/usr/share/zsh/site-functions/"
102      mkdir -p "${pkgdir}/usr/share/fish/vendor_completions.d/"
103      install -Dm644 "./completions/crush.bash" "${pkgdir}/usr/share/bash-completion/completions/crush"
104      install -Dm644 "./completions/crush.zsh" "${pkgdir}/usr/share/zsh/site-functions/_crush"
105      install -Dm644 "./completions/crush.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/crush.fish"
106      # man pages
107      install -Dm644 "./manpages/crush.1.gz" "${pkgdir}/usr/share/man/man1/crush.1.gz"
108      # readme
109      mkdir -pv "${pkgdir}/usr/share/doc/crush/"
110      install -Dm644 README* "${pkgdir}/usr/share/doc/crush/"
111
112furies:
113  - disable: "{{ .IsNightly }}"
114    account: "{{ with .Env.FURY_TOKEN }}charmcli{{ else }}{{ end }}"
115    secret_name: FURY_TOKEN
116
117brews:
118  - repository:
119      owner: charmbracelet
120      name: homebrew-tap
121      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
122    goarm: 7
123    extra_install: |-
124      bash_completion.install "completions/{{ .ProjectName }}.bash" => "{{ .ProjectName }}"
125      zsh_completion.install "completions/{{ .ProjectName }}.zsh" => "_{{ .ProjectName }}"
126      fish_completion.install "completions/{{ .ProjectName }}.fish"
127      man1.install "manpages/{{ .ProjectName }}.1.gz"
128
129npms:
130  - name: "@charmland/crush"
131    repository: "git+https://github.com/charmbracelet/crush.git"
132    bugs: https://github.com/charmbracelet/crush/issues
133    access: public
134
135nfpms:
136  - formats:
137      - apk
138      - deb
139      - rpm
140      - archlinux
141    file_name_template: "{{ .ConventionalFileName }}"
142    contents:
143      - src: ./completions/crush.bash
144        dst: /etc/bash_completion.d/crush
145      - src: ./completions/crush.fish
146        dst: /usr/share/fish/vendor_completions.d/crush.fish
147      - src: ./completions/crush.zsh
148        dst: /usr/share/zsh/site-functions/_crush
149      - src: ./manpages/crush.1.gz
150        dst: /usr/share/man/man1/crush.1.gz
151    rpm:
152      signature:
153        key_file: '{{ if ne (index .Env "GPG_KEY_PATH") "" }}{{ .Env.GPG_KEY_PATH }}{{ else }}{{ end }}'
154    deb:
155      signature:
156        key_file: '{{ if ne (index .Env "GPG_KEY_PATH") "" }}{{ .Env.GPG_KEY_PATH }}{{ else }}{{ end }}'
157
158signs:
159  - cmd: cosign
160    certificate: "${artifact}.pem"
161    args:
162      - sign-blob
163      - "--output-certificate=${certificate}"
164      - "--output-signature=${signature}"
165      - "${artifact}"
166      - "--yes"
167    artifacts: checksum
168    output: true
169
170source:
171  enabled: true
172
173sboms:
174  - artifacts: archive
175  - id: source
176    artifacts: source
177
178nix:
179  - repository:
180      owner: "charmbracelet"
181      name: nur
182      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
183    license: fsl11Mit
184    extra_install: |-
185      installManPage ./manpages/crush.1.gz
186      installShellCompletion ./completions/*
187
188winget:
189  - publisher: charmbracelet
190    copyright: Charmbracelet, Inc
191    repository:
192      owner: "charmbracelet"
193      name: winget-pkgs
194      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
195      branch: "crush-{{.Version}}"
196      pull_request:
197        enabled: true
198        draft: false
199        check_boxes: true
200        base:
201          owner: microsoft
202          name: winget-pkgs
203          branch: master
204
205changelog:
206  sort: asc
207  disable: "{{ .IsNightly }}"
208  filters:
209    exclude:
210      - "^(build|ci): "
211      - "^chore: auto-update generated files$"
212      - "^chore: docs$"
213      - "^chore: schema update$"
214      - "^chore: schema$"
215      - "^chore: typo$"
216      - "^chore: update schema$"
217      - "^chore: update$"
218      - "^chore\\(deps\\): "
219      - "^docs: update$"
220      - "^test:"
221      - "^test\\("
222      - "merge conflict"
223      - "merge conflict"
224      - Merge branch
225      - Merge pull request
226      - Merge remote-tracking branch
227      - go mod tidy
228      - "^wip "
229      - "^wip:"
230  groups:
231    - title: "New Features"
232      regexp: '^.*?feat(\(.+\))??!?:.+$'
233      order: 100
234    - title: "Security updates"
235      regexp: '^.*?sec(\(.+\))??!?:.+$'
236      order: 150
237    - title: "Bug fixes and improvements"
238      regexp: '^.*?(fix|refactor)(\(.+\))??!?:.+$'
239      order: 200
240    - title: "Documentation updates"
241      regexp: ^.*?docs?(\(.+\))??!?:.+$
242      order: 400
243    - title: Other work
244      order: 9999
245
246release:
247  prerelease: auto
248  footer:
249    from_url:
250      url: https://raw.githubusercontent.com/charmbracelet/meta/main/footer.md