env:
  - GO111MODULE=on
before:
  hooks:
    - go mod download

builds:
  - id: rxtx
    main: ./rxtx.go
    binary: rxtx

    ldflags: -a -installsuffix cgo

    goos:
      - linux
      - darwin
      - windows
    goarch:
      - "386"
      - amd64
      - arm
      - arm64
    goarm:
      - 6
    mod_timestamp: '{{ .CommitTimestamp }}'
    env:
      - CGO_ENABLED=0
    flags:
      - -trimpath
      - -tags=netgo
      - -a
      - -v

checksum:
  name_template: '{{ .ProjectName }}_checksums.txt'

changelog:
  sort: asc
  filters:
    exclude:
      - '^docs:'
      - '^test:'
      - Merge pull request
      - Merge branch
      - go mod tidy

nfpms:
  - file_name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
    homepage:  https://github.com/txn2/rxtx
    description: Queue based data collector, transmitter with store-and-forward. Useful for online/offline data collection, back pressure buffering or general queuing. REST / HTTP post.
    maintainer: Craig Johnston https://twitter.com/cjimti
    license: MIT License
    vendor: https://github.com/txn2
    formats:
      - apk
      - deb
      - rpm

release:
  github:
    owner: txn2
    name: rxtx
  name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}"

dockers:
  -
    goos: linux
    goarch: amd64
    goarm: ''
    image_templates:
      - "txn2/rxtx:latest"
      - "txn2/rxtx:{{ .Version }}"
      - "txn2/rxtx:{{ .Tag }}"
      - "txn2/rxtx:v{{ .Major }}"
    dockerfile: Dockerfile
    build_flag_templates:
      - "--label=org.label-schema.schema-version=1.0"
      - "--label=org.label-schema.version={{.Version}}"
      - "--label=org.label-schema.name={{.ProjectName}}"

brews:
  - name: rxtx
    tap:
      owner: txn2
      name: homebrew-tap
    commit_author:
      name: Craig Johnston
      email: cjimti@gmail.com
    folder: Formula
    homepage: https://github.com/txn2/rxtx
    description: "Data queuing, batching and re-transmission."