# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
builds:
- env:
  - CGO_ENABLED=0
  goos:
  - linux
  - freebsd
  - openbsd
  goarch:
    - amd64
    - arm
    - arm64
  ldflags:
  - -s -w -X "github.com/kopia/kopia/repo.BuildVersion={{.Version}}" -X "github.com/kopia/kopia/repo.BuildInfo={{.Commit}}" -X "github.com/kopia/kopia/repo.BuildGitHubRepo={{.Env.GITHUB_REPOSITORY}}"
release:
  draft: false
archives:
  - id: default
    replacements:
      darwin: macOS
      linux: linux
      windows: windows
      freebsd: freebsd-experimental
      openbsd: openbsd-experimental
      amd64: x64
    name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
    wrap_in_directory: true
    format_overrides:
    - goos: windows
      format: zip
    files:
      - LICENSE
      - README.md
checksum:
  name_template: 'checksums.txt'
snapshot:
  name_template: '{{ .Env.KOPIA_VERSION_NO_PREFIX }}'
nfpms:
  - homepage: https://kopia.io
    vendor: Kopia Project
    maintainer: Kopia Project <kopia-pmc@googlegroups.com>
    description: Fast and secure open source backup.
    license: Apache 2.0
    file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
    replacements:
      arm: armhf
    formats:
    - deb
    - rpm
    bindir: /usr/bin
    overrides:
      rpm:
        file_name_template: "{{ .ProjectName }}-{{ .Version }}.{{ .Arch }}"
        replacements:
          amd64: x86_64
          arm64: aarch64
          arm: armhfp
signs:
  - id: all
    artifacts: checksum
    cmd: tools/sign.sh
    args: ["${artifact}", "${signature}"]
changelog:
  filters:
    exclude:
    - '^docs:'
    - '^test:'
