version: 2

project_name: coprctl

before:
  hooks:
    - go mod tidy

builds:
  - id: coprctl
    main: ./cmd/coprctl
    binary: coprctl
    env:
      - CGO_ENABLED=0
    ldflags:
      - -s -w
      - -X github.com/abn/coprctl/internal/cli.version={{.Version}}
      - -X github.com/abn/coprctl/internal/cli.commit={{.Commit}}
      - -X github.com/abn/coprctl/internal/cli.date={{.Date}}
    goos:
      - linux
      - darwin
      - windows
    goarch:
      - amd64
      - arm64
    ignore:
      - goos: windows
        goarch: arm64

archives:
  - format: tar.gz
    name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
    files:
      - LICENSE
      - README.md

checksum:
  name_template: "checksums.txt"

snapshot:
  version_template: "{{ incpatch .Version }}-next"

changelog:
  sort: asc
  filters:
    exclude:
      - "^docs:"
      - "^chore:"
