version: 2
project_name: gtree
env:
  - GO111MODULE=on
before:
  hooks:
    - go mod tidy
builds:
  - id: gtree
    main: ./cmd/gtree
    binary: gtree
    ldflags:
      - -s -w
      - -X main.Version={{.Version}}
      - -X main.Revision={{.ShortCommit}}
    goos:
      - darwin
      - windows
    env:
      - CGO_ENABLED=0
  - id: gtree-linux
    main: ./cmd/gtree
    binary: gtree
    ldflags:
      - -s -w
      - -X main.Version={{.Version}}
      - -X main.Revision={{.ShortCommit}}
    goos:
      - linux
    env:
      - CGO_ENABLED=0
archives:
  - name_template: >-
      {{ .ProjectName }}_
      {{- title .Os }}_
      {{- if eq .Arch "amd64" }}x86_64
      {{- else if eq .Arch "386" }}i386
      {{- else }}{{ .Arch }}{{ end }}
    format_overrides:
      - goos: windows
        format: zip
    files:
      - LICENSE
      - CREDITS
release:
  prerelease: auto
brews:
  - repository:
      owner: ddddddO
      name: homebrew-tap
      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
    directory: Formula
    homepage: "https://github.com/ddddddO/gtree"
    description: "This CLI uses Markdown to generate directory trees and directories itself, and also verifies directories."
    license: "BSD-2-Clause"
scoops:
  - repository:
      owner: ddddddO
      name: scoop-bucket
      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
    url_template: "https://github.com/ddddddO/gtree/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
    homepage: "https://github.com/ddddddO/gtree"
    description: "This CLI uses Markdown to generate directory trees and directories itself, and also verifies directories."
    license: "BSD-2-Clause"
nfpms:
  - id: gtree-nfpms
    file_name_template: "{{ .ProjectName }}_{{ .Version }}-1_{{ .Arch }}"
    builds:
      - gtree-linux
    homepage: https://github.com/ddddddO/gtree
    maintainer: ddddddO <lbfdeatq@gmail.com>
    description: This CLI uses Markdown to generate directory trees and directories itself, and also verifies directories.
    license: BSD-2-Clause
    formats:
      - deb
      - rpm
      - apk
    bindir: /usr/bin
    epoch: 1
