project_name: srink
release:
  replace_existing_draft: true
  header: |
    Welcome to this new release!
  footer: |
    Docker Images:
    `ghcr.io/srinkco/{{ .ProjectName }}:latest`
before:
  hooks:
    - go mod tidy
    - go mod download
builds:
  - goos:
      - linux
      - windows
      - darwin
    goarch:
      - amd64
      - arm64
    mod_timestamp: "{{ .CommitTimestamp }}"
    flags:
      - -trimpath
    ldflags:
      - -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }}
archives:
  - format: binary
checksum:
  name_template: "checksums.txt"
snapshot:
  name_template: "{{ incpatch .Version }}-next"

dockers:
  # amd64 only
  - goarch: amd64
    dockerfile: goreleaser.Dockerfile
    use: buildx
    image_templates:
      - "ghcr.io/srinkco/{{ .ProjectName }}:{{ .Tag }}-amd64"
    build_flag_templates:
      - "--platform=linux/amd64"
      - "--pull"
      - "--label=org.opencontainers.image.created={{.Date}}"
      - "--label=org.opencontainers.image.title={{ .ProjectName }}"
      - "--label=org.opencontainers.image.revision={{.FullCommit}}"
      - "--label=org.opencontainers.image.version={{.Version}}"
  # arm64 only
  - goarch: arm64
    dockerfile: goreleaser.Dockerfile
    use: buildx
    image_templates:
      - "ghcr.io/srinkco/{{ .ProjectName }}:{{ .Tag }}-arm64v8"
    build_flag_templates:
      - "--platform=linux/arm64/v8"
      - "--pull"
      - "--label=org.opencontainers.image.created={{.Date}}"
      - "--label=org.opencontainers.image.title={{ .ProjectName }}"
      - "--label=org.opencontainers.image.revision={{.FullCommit}}"
      - "--label=org.opencontainers.image.version={{.Version}}"

docker_manifests:
  # github container registry
  - name_template: "ghcr.io/srinkco/{{ .ProjectName }}:{{ .Version }}"
    image_templates:
      - "ghcr.io/srinkco/{{ .ProjectName }}:{{ .Tag }}-amd64"
      - "ghcr.io/srinkco/{{ .ProjectName }}:{{ .Tag }}-arm64v8"
  - name_template: "ghcr.io/srinkco/{{ .ProjectName }}:latest"
    image_templates:
      - "ghcr.io/srinkco/{{ .ProjectName }}:{{ .Tag }}-amd64"
      - "ghcr.io/srinkco/{{ .ProjectName }}:{{ .Tag }}-arm64v8"
