version: 2
changelog:
  disable: true

checksum:
  name_template: "{{.ProjectName}}_linux_checksums.txt"

env:
  - GO111MODULE=on
  - GOPROXY=https://proxy.golang.org

before:
  hooks:
    - go mod download

archives:
  - name_template: "berty_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
    wrap_in_directory: true
    id: berty
    ids:
      - berty
  - name_template: "bertygui_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
    wrap_in_directory: true
    id: bertygui
    ids:
      - bertygui

builds:
  - id: berty
    binary: berty
    env:
      - CGO_ENABLED=1
    goos:
      - linux
    goarch:
      - amd64
      #- arm64
    dir: go/cmd/berty
    flags:
      - "-a"
    ldflags:
      - "-X berty.tech/berty/v2/go/pkg/bertyversion.VcsRef=$(VCS_REF) -X berty.tech/berty/v2/go/pkg/bertyversion.Version=$(VERSION)"

  - id: bertygui
    binary: bertygui
    env:
      - CGO_ENABLED=1
    goos:
      - linux
    goarch:
      - amd64
    dir: go/cmd/berty
    flags:
      - "-a"
      - "-tags=bertygui"
    ldflags:
      - "-X berty.tech/berty/v2/go/pkg/bertyversion.VcsRef=$(VCS_REF) -X berty.tech/berty/v2/go/pkg/bertyversion.Version=$(VERSION)"
