version: 2
project_name: soh-router
env:
  - GO111MODULE=on
before:
  hooks:
    - go mod tidy

builds:
  -
    id: linux
    goarch:
      - arm64
      - amd64
      - arm
    goarm:
      - 5
    goos:
      - linux

archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
  files:
    - LICENSE
    - README.md
    - soh-router.service
    - config.yaml

nfpms:
- file_name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
  homepage:  https://github.com/Jmainguy/soh-router
  description: A golang router for the soh.re website
  maintainer: Jonathan Seth Mainguy <jon@soh.re>
  license: GPLv2
  vendor: Jmainguy
  release: 1
  overrides:
      deb:
        file_name_template: "{{ .ProjectName }}_{{ .Version }}-{{.Release}}_{{ .Arch }}"
  formats:
  - deb
  bindir: /usr/bin
  contents:
    - src: soh-router.service
      dst: /usr/lib/systemd/system/soh-router.service
    - src: config.yaml
      dst: /etc/soh-router/config.yaml
    - dst: /opt/soh-router
      type: dir
      file_info:
        mode: 0755
    - dst: /etc/soh-router
      type: dir
      file_info:
        mode: 0755
