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