version: 2

gitea_urls:
  api: "{{ if index .Env \"GITEA_API_URL\" }}{{ .Env.GITEA_API_URL }}{{ else }}https://gitea.lerkolabs.com/api/v1{{ end }}"
  download: https://gitea.lerkolabs.com

release:
  gitea:
    owner: lerkolabs
    name: uptop

builds:
  - main: ./cmd/uptop/main.go
    binary: uptop
    env:
      - CGO_ENABLED=1
    goos:
      - linux
    goarch:
      - amd64
    ldflags:
      - -s -w
      - -X main.version={{ .Version }}
      - -X main.commit={{ .Commit }}
      - -X main.date={{ .Date }}
    flags:
      - -trimpath

archives:
  - formats: [tar.gz]
    name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"

checksum:
  name_template: checksums.txt

nfpms:
  - package_name: uptop
    file_name_template: "{{ .ConventionalFileName }}"
    vendor: LerkoLabs
    homepage: https://gitea.lerkolabs.com/lerkolabs/uptop
    maintainer: Tyler Koenig <tyler@lerkolabs.com>
    description: Self-hosted uptime monitoring with a TUI over SSH
    license: MIT
    section: net
    priority: optional
    formats:
      - deb
      - rpm
    bindir: /usr/bin
    contents:
      - src: ./LICENSE
        dst: /usr/share/doc/uptop/LICENSE
        type: doc

homebrew_casks:
  - name: uptop
    homepage: https://gitea.lerkolabs.com/lerkolabs/uptop
    description: Self-hosted uptime monitoring with a TUI over SSH
    directory: Casks
    skip_upload: true
    commit_msg_template: "update uptop to {{ .Tag }}"
    url:
      template: "https://gitea.lerkolabs.com/lerkolabs/uptop/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
    repository:
      owner: lerkolabs
      name: homebrew-tap
      git:
        url: "ssh://git@gitea.lerkolabs.com:2222/lerkolabs/homebrew-tap.git"
        private_key: "{{ if index .Env \"TAP_SSH_KEY\" }}{{ .Env.TAP_SSH_KEY }}{{ end }}"
        ssh_command: "ssh -o StrictHostKeyChecking=accept-new"

changelog:
  disable: true
