before:
  hooks:
    - go mod tidy

builds:
- env:
    - CGO_ENABLED=0
  goos:
    - linux
    - windows
    - darwin
  main: ./cmd/opr/main.go
  ldflags:
      - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}}


archives:
  - format: tar.gz
    name_template: >-
      {{ .ProjectName }}_
      {{- if eq .Os "darwin" }}mac_os
      {{- else }}{{ .Os }}{{ end }}_
      {{- if eq .Arch "amd64" }}x86_64
      {{- else if eq .Arch "386" }}i386
      {{- else }}{{ .Arch }}{{ end }}
      {{- if .Arm }}v{{ .Arm }}{{ end }}
    format_overrides:
    - goos: windows
      format: zip

checksum:
  algorithm: sha256
  name_template: 'opr-checksums.sha256.txt'

signs:
  - artifacts: checksum
    cmd: "gpg"
    args: ["-u", "B2165DEA86E9239A64FE248AF32C89E2AEA58760", "--detach-sign", "${artifact}"]

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

changelog:
  sort: asc
  filters:
    exclude:
      - '^docs:'
      - '^test:'