project_name: harp

before:
  hooks:
    - go mod tidy
    - go mod vendor

gomod:
  proxy: true

builds:
  - id: harp
    main: './cmd/harp'
    env:
      - CGO_ENABLED=0
    mod_timestamp: '{{ .CommitTimestamp }}'
    flags:
      - -trimpath
    ldflags:
      - '-s'
      - '-w'
      - '-X github.com/elastic/harp/build/version.Name=harp'
      - '-X github.com/elastic/harp/build/version.AppName=github.com/elastic/harp/cmd/harp'
      - '-X github.com/elastic/harp/build/version.Version={{.Version}}'
      - '-X github.com/elastic/harp/build/version.Commit={{.CommitDate}}'
      - '-X github.com/elastic/harp/build/version.Branch={{.Branch}}'
      - '-X github.com/elastic/harp/build/version.BuildDate={{.Date}}'
      - '-X github.com/elastic/harp/build/version.BuildTags=defaults'
    targets:
      - darwin_amd64
      - darwin_arm64
      - linux_amd64
      - linux_arm
      - linux_arm64
      - windows_amd64
      - windows_arm
      - windows_arm64
    binary: 'harp-{{replace .Target "_" "-"}}'
    hooks:
      post:
        - cmd: cyclonedx-gomod app -main ./cmd/harp -licenses -packages -json -output "dist/harp-{{replace .Target "_" "-"}}.sbom.json"
          env:
            - GOARCH={{ .Arch }}
            - GOOS={{ .Os }}
    no_unique_dist_dir: true

archives:
  - format: binary
    name_template: '{{ .Binary }}'

snapshot:
  name_template: "{{.Tag}}-next"

checksum:
  name_template: 'checksums.txt'

release:
  disable: true

changelog:
  skip: true
