version: 2
project_name: helmfile
env:
  # We default to non-v1 mode (=helmfile v0.x behavior) when HELMFILE_V1MODE is not set
  - HELMFILE_V1MODE={{ if index .Env "HELMFILE_V1MODE"  }}{{ .Env.HELMFILE_V1MODE }}{{ else }}false{{ end }}
builds:
  - id: helmfile
    main: .
    env:
      - CGO_ENABLED=0
    ldflags:
      - -s -w
      - -X go.szostok.io/version.version={{.Version}}
      - -X go.szostok.io/version.buildDate={{.Date}}
      - -X go.szostok.io/version.commit={{.FullCommit}}
      - -X go.szostok.io/version.commitDate={{.CommitDate}}
      - -X go.szostok.io/version.dirtyBuild=false
      - -X github.com/helmfile/helmfile/pkg/runtime.v1Mode={{.Env.HELMFILE_V1MODE}}
    goos:
      - darwin
      - linux
      - windows
    goarch:
      - amd64
      - arm64
      - "386"

changelog:
  use: github
  sort: asc
  groups:
    - title: Features
      regexp: '^.*[Ff]eat[(\\w)]*:+.*$'
      order: 0
    - title: "Fixes"
      regexp: '^.*fix[(\\w)]*.*$'
      order: 1
    - title: "Dependencies"
      regexp: '^.*(deps|bump)[(\\w)]*.*$'
      order: 2
    - title: Others
      order: 999
