env:
  - GO111MODULE=on
before:
  hooks:
    # You may remove this if you don't use go modules.
    - go mod tidy
builds:
  - id: pimp-my-shell
    binary: pimp-my-shell
    flags:
      - -trimpath
    asmflags:
      - all=-trimpath={{.Env.GOPATH}}
    gcflags:
      - all=-trimpath={{.Env.GOPATH}}
    ldflags: |
      -s -w
    goos:
      - linux
      - darwin
    goarch:
      - amd64
      - arm64
    env:
      - CGO_ENABLED=0
      - >-
        {{- if eq .Os "darwin" }}
          {{- if eq .Arch "amd64"}}CC=o64-clang{{- end }}
          {{- if eq .Arch "arm64"}}CC=aarch64-apple-darwin20.2-clang{{- end }}
        {{- end }}
      - >-
        {{- if eq .Os "darwin" }}
          {{- if eq .Arch "amd64"}}CXX=o64-clang+{{- end }}
          {{- if eq .Arch "arm64"}}CXX=aarch64-apple-darwin20.2-clang++{{- end }}
        {{- end }}

archives:
  - id: tgz
    format: tar.gz
    format_overrides:
      - goos: windows
        format: zip

checksum:
  name_template: 'checksums.txt'

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