---
project_name: SyncFlaer
before:
  hooks:
    - go mod tidy
builds:
  - main: ./cmd/syncflaer
    env:
      - CGO_ENABLED=0
    goos:
      - linux
      - darwin
      - windows
    goarch:
      - amd64
      - arm64
      - arm
dockers:
  - image_templates:
      - ghcr.io/containeroo/syncflaer:{{ .Tag }}-amd64
      - containeroo/syncflaer:{{ .Tag }}-amd64
    use: buildx
    dockerfile: Dockerfile
    extra_files:
      - go.mod
      - go.sum
      - cmd
      - internal
    build_flag_templates:
      - --pull
      - --platform=linux/amd64
      - --label=org.opencontainers.image.title={{ .ProjectName }}
      - --label=org.opencontainers.image.description={{ .ProjectName }}
      - --label=org.opencontainers.image.url=https://github.com/containeroo/syncflaer
      - --label=org.opencontainers.image.source=https://github.com/containeroo/syncflaer
      - --label=org.opencontainers.image.version={{ .Version }}
      - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
      - --label=org.opencontainers.image.revision={{ .FullCommit }}
      - --label=org.opencontainers.image.licenses="GNU General Public License v3.0"
  - image_templates:
      - ghcr.io/containeroo/syncflaer:{{ .Tag }}-arm64
      - containeroo/syncflaer:{{ .Tag }}-arm64
    use: buildx
    dockerfile: Dockerfile
    extra_files:
      - go.mod
      - go.sum
      - cmd
      - internal
    goarch: arm64
    build_flag_templates:
      - --pull
      - --platform=linux/arm64
      - --label=org.opencontainers.image.title={{ .ProjectName }}
      - --label=org.opencontainers.image.description={{ .ProjectName }}
      - --label=org.opencontainers.image.url=https://github.com/containeroo/syncflaer
      - --label=org.opencontainers.image.source=https://github.com/containeroo/syncflaer
      - --label=org.opencontainers.image.version={{ .Version }}
      - --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
      - --label=org.opencontainers.image.revision={{ .FullCommit }}
      - --label=org.opencontainers.image.licenses="GNU General Public License v3.0"
docker_manifests:
  - name_template: containeroo/syncflaer:{{ .Tag }}
    image_templates:
      - containeroo/syncflaer:{{ .Tag }}-amd64
      - containeroo/syncflaer:{{ .Tag }}-arm64
  - name_template: ghcr.io/containeroo/syncflaer:{{ .Tag }}
    image_templates:
      - ghcr.io/containeroo/syncflaer:{{ .Tag }}-amd64
      - ghcr.io/containeroo/syncflaer:{{ .Tag }}-arm64
  - name_template: containeroo/syncflaer:latest
    image_templates:
      - containeroo/syncflaer:{{ .Tag }}-amd64
      - containeroo/syncflaer:{{ .Tag }}-arm64
  - name_template: ghcr.io/containeroo/syncflaer:latest
    image_templates:
      - ghcr.io/containeroo/syncflaer:{{ .Tag }}-amd64
      - ghcr.io/containeroo/syncflaer:{{ .Tag }}-arm64
brews:
  - name: syncflaer
    tap:
      owner: containeroo
      name: homebrew-tap
      token: "{{ .Env.TAP_GITHUB_TOKEN }}"
    folder: Formula
    homepage: https://containeroo.ch
    description: Synchronize Traefik host rules and/or Kubernetes Ingresses with Cloudflare
    license: GNU General Public License v3.0
    test: |
      system "#{bin}/syncflaer --version"
    dependencies:
      - name: go
        type: optional
    install: |-
      bin.install "syncflaer"
