builds:
  - binary: grpcurl
    main: ./cmd/grpcurl
    goos:
      - linux
      - darwin
      - windows
    goarch:
      - amd64
      - 386
      - arm
      - arm64
      - s390x
      - ppc64le
    goarm:
      - 5
      - 6
      - 7
    ignore:
      - goos: darwin
        goarch: 386
      - goos: windows
        goarch: arm64
      - goos: darwin
        goarch: arm
      - goos: windows
        goarch: arm
      - goos: darwin
        goarch: s390x
      - goos: windows
        goarch: s390x
      - goos: darwin
        goarch: ppc64le
      - goos: windows
        goarch: ppc64le
    ldflags:
      - -s -w -X main.version=v{{.Version}}

archives:
  - format: tar.gz
    name_template: >-
      {{ .Binary }}_{{ .Version }}_
      {{- if eq .Os "darwin" }}osx{{ else }}{{ .Os }}{{ end }}_
      {{- if eq .Arch "amd64" }}x86_64
      {{- else if eq .Arch "386" }}x86_32
      {{- else }}{{ .Arch }}{{ end }}
      {{- with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}
    format_overrides:
      - goos: windows
        format: zip
    files:
      - LICENSE

nfpms:
  - vendor: Fullstory
    homepage: https://github.com/fullstorydev/grpcurl/
    maintainer: Engineering at Fullstory  <fixme@fixme>
    description: 'Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers'
    license: MIT
    id: nfpms
    formats:
      - deb
      - rpm
