version: 2

builds:
  - id: dynamo-browse_macos
    targets:
      - darwin_amd64
      - darwin_arm64
    env:
      - CGO_ENABLED=0
    main: ./cmd/dynamo-browse/.
    binary: dynamo-browse
  - id: dynamo-browse_linux
    targets:
      - linux_amd64
      - linux_arm64
    env:
      - CGO_ENABLED=0
    main: ./cmd/dynamo-browse/.
    binary: dynamo-browse

archives:
  - id: tgz
    wrap_in_directory: false
    formats:
      - tar.gz

# MacOS Release: notarise and publish via Homebrew Tap
notarize:
  macos:
    - enabled: true
      ids:
        - dynamo-browse_macos
      sign:
        certificate: "{{.Env.MACOS_SIGN_P12}}"
        password: "{{.Env.MACOS_SIGN_PASSWORD}}"
      notarize:
        issuer_id: "{{.Env.MACOS_NOTARY_ISSUER_ID}}"
        key_id: "{{.Env.MACOS_NOTARY_KEY_ID}}"
        key: "{{.Env.MACOS_NOTARY_KEY}}"
        wait: true
        timeout: 20m

homebrew_casks:
  - name: dynamo-browse
    ids:
      - dynamo-browse_macos
    repository:
      owner: casks
      name: dynamo-browse
      git:
        url: 'forgejo@lmika.dev:casks/dynamo-browse.git'
        private_key: "{{ .Env.HOMEBREW_TAP_PRIVATE_KEY }}"
    directory: Casks
    homepage:  https://dynamo-browse.lmika.dev/
    description: TUI tools for working with DynamoDB
    license: MIT

# Linux releases: publish as deb and rpm packages
nfpms:
  - id: package_nfpms
    package_name: audax
    ids:
      - dynamo-browse_linux
    vendor: lmika
    homepage: https://dynamo-browse.lmika.dev/
    maintainer: Leon Mika <lmika@lmika.org>
    description: TUI tools for working with DynamoDB
    license: MIT
    formats:
      - deb
      - rpm
    bindir: /usr/local/bin

release:
  gitea:
    owner: cmd
    name: dynamo-browse
  ids:
    - tgz

checksum:
  name_template: 'checksums.txt'

snapshot:
  version_template: "{{ .Tag }}-next"

gitea_urls:
  api: https://lmika.dev/api/v1
  download: https://lmika.dev
  # set to true if you use a self-signed certificate
  skip_tls_verify: false
