project_name: adguard-exporter

before:
  hooks:
    - go mod tidy

builds:
  - id: universal
    main: main.go
    binary: adguard-exporter
    env: [CGO_ENABLED=0]
    goos:
      - linux
      - windows
      - darwin
    goarch:
      - amd64
      - arm64
      - arm

archives:
  - format: tar.gz
    name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
    files:
      - LICENSE
      - README.md

checksum:
  name_template: 'checksums.txt'

dockers:
  - id: docker-amd64
    ids: [universal]
    goos: linux
    goarch: amd64
    use: buildx
    dockerfile: Dockerfile
    build_flag_templates:
      - "--platform=linux/amd64"
    image_templates:
      - ghcr.io/znand-dev/adguardexporter:{{ .Tag }}-amd64
      - ghcr.io/znand-dev/adguardexporter:latest-amd64

  - id: docker-arm64
    ids: [universal]
    goos: linux
    goarch: arm64
    use: buildx
    dockerfile: Dockerfile
    build_flag_templates:
      - "--platform=linux/arm64"
    image_templates:
      - ghcr.io/znand-dev/adguardexporter:{{ .Tag }}-arm64v8
      - ghcr.io/znand-dev/adguardexporter:latest-arm64v8

  - id: docker-arm
    ids: [universal]
    goos: linux
    goarch: arm
    use: buildx
    dockerfile: Dockerfile
    build_flag_templates:
      - "--platform=linux/arm/v6"
    image_templates:
      - ghcr.io/znand-dev/adguardexporter:{{ .Tag }}-armv6
      - ghcr.io/znand-dev/adguardexporter:latest-armv6

docker_manifests:
  - name_template: ghcr.io/znand-dev/adguardexporter:{{ .Tag }}
    image_templates:
      - ghcr.io/znand-dev/adguardexporter:{{ .Tag }}-amd64
      - ghcr.io/znand-dev/adguardexporter:{{ .Tag }}-arm64v8
      - ghcr.io/znand-dev/adguardexporter:{{ .Tag }}-armv6

  - name_template: ghcr.io/znand-dev/adguardexporter:latest
    image_templates:
      - ghcr.io/znand-dev/adguardexporter:latest-amd64
      - ghcr.io/znand-dev/adguardexporter:latest-arm64v8
      - ghcr.io/znand-dev/adguardexporter:latest-armv6
