version: 2
before:
  hooks:
    - go mod tidy
builds:
-
  goos:
  - freebsd
  - netbsd
  - openbsd
  - dragonfly
  - linux
  - darwin
  - windows
  goarch:
  - 386
  - amd64
  - arm
  - arm64
  - mips
  - mipsle
  - mips64
  - mips64le
  goarm:
  - 5
  - 6
  - 7
  gomips:
  - softfloat
  - hardfloat
  env:
  - CGO_ENABLED={{ if eq .Os "darwin" }}1{{ else }}0{{ end }}
  flags:
  - -trimpath
  ignore:
  -
    goos: windows
    goarch: arm
  -
    goos: windows
    goarch: arm64
archives:
-
  format_overrides:
  -
    goos: windows
    format: zip
  files:
  - LICENSE
  - README.md
checksum:
  name_template: 'checksums.txt'
release:
  github:
    owner: nextdns
    name: nextdns
  name_template: "{{.ProjectName}}-v{{.Version}}"
brews:
-
  repository:
    owner: nextdns
    name: homebrew-tap
  commit_author:
    name: NextDNS Team
    email: team@nextdns.io
  homepage: https://nextdns.io
  description: NextDNS DNS/53 to DoH Proxy
  caveats: "To install NextDNS, run the following command:

    sudo nextdns install --profile <your_profile_id>

Then setup your DNS manually to 127.0.0.1 or by running:

    sudo nextdns activate
"
nfpms:
  -
    vendor: NextDNS Inc
    homepage: https://nextdns.io
    maintainer: NextDNS Team <team@nextdns.io>
    description: NextDNS DNS/53 to DoH Proxy
    license: MIT
    formats:
      - deb
      - rpm
      - apk
    bindir: /usr/bin
    dependencies:
      - curl
    overrides:
      deb:
        scripts:
          postinstall: ".goreleaser/deb/postinst"
          preremove: ".goreleaser/deb/prerm"
      rpm:
        scripts:
          postinstall: ".goreleaser/rpm/post"
          preremove: ".goreleaser/rpm/preun"
      apk:
        scripts:
          postinstall: ".goreleaser/apk/post-install"
          preremove: ".goreleaser/apk/pre-deinstall"
    apk:
      scripts:
          postupgrade: ".goreleaser/apk/post-upgrade"
dockers:
  - image_templates:
      - "nextdns/nextdns:{{ .Version }}-amd64"
    use: buildx
    dockerfile: Dockerfile
    build_flag_templates: ["--platform=linux/amd64"]
  - image_templates:
      - "nextdns/nextdns:{{ .Version }}-armv7"
    use: buildx
    goarch: arm
    goarm: 7
    dockerfile: Dockerfile
    build_flag_templates:
      - "--platform=linux/arm/v7"
  - image_templates:
      - "nextdns/nextdns:{{ .Version }}-arm64"
    use: buildx
    goarch: arm64
    dockerfile: Dockerfile
    build_flag_templates:
      - "--platform=linux/arm64"
docker_manifests:
  - name_template: "nextdns/nextdns:{{ .Version }}"
    image_templates:
      - "nextdns/nextdns:{{ .Version }}-amd64"
      - "nextdns/nextdns:{{ .Version }}-armv7"
      - "nextdns/nextdns:{{ .Version }}-arm64"
  - name_template: "nextdns/nextdns:latest"
    image_templates:
      - "nextdns/nextdns:{{ .Version }}-amd64"
      - "nextdns/nextdns:{{ .Version }}-armv7"
      - "nextdns/nextdns:{{ .Version }}-arm64"
changelog:
  groups:
    - title: "✨ New Features"
      regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
      order: 0
    - title: "🐛 Bug Fixes"
      regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
      order: 1
    - title: "⚡ Performance Improvements"
      regexp: '^.*?perf(\([[:word:]]+\))??!?:.+$'
      order: 2
    - title: "📚 Documentation Updates"
      regexp: '^.*?docs(\([[:word:]]+\))??!?:.+$'
      order: 3
    - title: "🛠️ Maintenance Changes"
      regexp: '^.*?chore(\([[:word:]]+\))??!?:.+$'
      order: 4
    - title: "🤖 Continuous Integration Changes"
      regexp: '^.*?ci(\([[:word:]]+\))??!?:.+$'
      order: 5
    - title: Others
      order: 999
