# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
# vim: set ts=2 sw=2 tw=0 fo=jcroql
version: 2

project_name: crush

metadata:
  mod_timestamp: "{{ .CommitTimestamp }}"
  license: "MIT"
  homepage: "https://charm.sh/crush"
  description: "A powerful terminal-based AI assistant for developers, providing intelligent coding assistance directly in your terminal."
  maintainers:
    - "kujtimiihoxha <kujtim@charm.sh>"

builds:
  - env:
      - CGO_ENABLED=0
    goos:
      - linux
      - darwin
      - windows
    goarch:
      - amd64
      - arm64
    ldflags:
      - -s -w -X github.com/charmbracelet/crush/internal/version.Version={{.Version}}
    main: ./main.go

archives:
  - formats: [tar.gz]
    name_template: >-
      crush-
      {{- if eq .Os "darwin" }}mac-
      {{- else if eq .Os "windows" }}windows-
      {{- else if eq .Os "linux" }}linux-{{end}}
      {{- if eq .Arch "amd64" }}x86_64
      {{- else if eq .Arch "#86" }}i386
      {{- else }}{{ .Arch }}{{ end }}
      {{- if .Arm }}v{{ .Arm }}{{ end }}
    format_overrides:
      - goos: windows
        formats: [zip]

checksum:
  name_template: "checksums.txt"

snapshot:
  version_template: "0.0.0-{{ .Timestamp }}"

aurs:
  - private_key: "{{ .Env.AUR_KEY }}"
    git_url: "ssh://aur@aur.archlinux.org/charmbracelet-bin.git"
    provides:
      - crush
    conflicts:
      - crush
    package: |-
      install -Dm755 ./crush "${pkgdir}/usr/bin/crush"

homebrew_casks:
  - repository:
      owner: charmbracelet
      name: homebrew-tap

nfpms:
  - formats:
      - deb
      - rpm
    file_name_template: >-
      {{ .ProjectName }}-
      {{- if eq .Os "darwin" }}mac
      {{- else }}{{ .Os }}{{ end }}-{{ .Arch }}

changelog:
  sort: asc
  filters:
    exclude:
      - "^docs:"
      - "^doc:"
      - "^test:"
      - "^ci:"
      - "^ignore:"
      - "^example:"
      - "^wip:"
