release:
  name_template: "{{ .ProjectName }} {{ .Env.RELEASE_DESCRIPTION }}"
  prerelease: auto # this should detect a release candidate and mark it as pre-release in GitHub

builds:
  - id: default
    main: ./cmd/eksctl
    binary: eksctl
    flags:
      - -tags
      - netgo release
      - -trimpath
    env:
      - CGO_ENABLED=0
    ldflags:
      # gitTag set from a generated file (see ./tag_release.sh)
      - -s -w -X github.com/weaveworks/eksctl/pkg/version.buildDate={{.Date}} -X github.com/weaveworks/eksctl/pkg/version.gitCommit={{.ShortCommit}} -X github.com/weaveworks/eksctl/pkg/version.PreReleaseID={{.Env.PRE_RELEASE_ID}}
    goos:
      - windows
      - darwin
      - linux
    goarch:
      - amd64
      - arm64
      - arm
    goarm:
      - 6
      - 7

archives:
  - id: default
    builds:
      - default
    name_template: "eksctl_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
    replacements:
      darwin: Darwin
      linux: Linux
      windows: Windows
    format: tar.gz
    format_overrides:
      - goos: windows
        format: zip
    files:
      - none*

checksum:
  name_template: "eksctl_checksums.txt"
