project_name: soft-serve

env:
  - GO111MODULE=on
  - CGO_ENABLED=0

before:
  hooks:
    - go mod download

builds:
  - id: "soft-serve"
    binary: "soft"
    ldflags: -s -w -X main.Version=v{{ .Version }} -X main.CommitSHA={{ .Commit }}
    goos:
      - linux
      - darwin
      - windows
    goarch:
      - amd64
      - arm64
      - "386"
      - arm
    goarm:
      - "6"
      - "7"
    ignore:
      - goos: windows
        goarch: arm64

archives:
  - id: default
    builds:
      - soft-serve
    format_overrides:
      - goos: windows
        format: zip
    replacements:
      windows: Windows
      darwin: Darwin
      386: i386
      amd64: x86_64

nfpms:
  - builds:
      - soft-serve

    vendor: charmbracelet
    homepage: "https://charm.sh/"
    maintainer: "Christian Rocha <christian@charm.sh>"
    description: "A personal key value store"
    license: MIT
    formats:
      - apk
      - deb
      - rpm
    bindir: /usr/bin

brews:
  - goarm: "6"
    tap:
      owner: charmbracelet
      name: homebrew-tap
      token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
    commit_author:
      name: "Christian Rocha"
      email: "christian@charm.sh"
    homepage: "https://charm.sh/"
    description: "A personal key value store"

signs:
  - artifacts: checksum

checksum:
  name_template: "checksums.txt"
snapshot:
  name_template: "{{ .Tag }}-next"
changelog:
  sort: asc
  filters:
    exclude:
      - "^docs:"
      - "^test:"

release:
  footer: |
    * * *
    Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli) or [The Fediverse](https://mastodon.technology/@charm).
    <a href="https://charm.sh/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-badge-unrounded.jpg" width="400"></a>

dockers:
  - image_templates:
      - "docker.io/charmcli/soft-serve:latest-amd64"
      - "docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-amd64"
      - "docker.io/charmcli/soft-serve:v{{ .Version }}-amd64"
      - "ghcr.io/charmbracelet/soft-serve:latest-amd64"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-amd64"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-amd64"
    ids: [soft-serve]
    goarch: amd64
    build_flag_templates:
      - --platform=linux/amd64
      - --label=org.opencontainers.image.title={{ .ProjectName }}
      - --label=org.opencontainers.image.description={{ .ProjectName }}
      - --label=org.opencontainers.image.url=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.source=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.version=v{{ .Version }}
      - --label=org.opencontainers.image.created={{ .Date }}
      - --label=org.opencontainers.image.revision={{ .FullCommit }}
      - --label=org.opencontainers.image.licenses=MIT
    dockerfile: Dockerfile
    use: buildx
  - image_templates:
      - "docker.io/charmcli/soft-serve:latest-i386"
      - "docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-i386"
      - "docker.io/charmcli/soft-serve:v{{ .Version }}-i386"
      - "ghcr.io/charmbracelet/soft-serve:latest-i386"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-i386"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-i386"
    ids: [soft-serve]
    goarch: "386"
    build_flag_templates:
      - --platform=linux/i386
      - --label=org.opencontainers.image.title={{ .ProjectName }}
      - --label=org.opencontainers.image.description={{ .ProjectName }}
      - --label=org.opencontainers.image.url=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.source=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.version=v{{ .Version }}
      - --label=org.opencontainers.image.created={{ .Date }}
      - --label=org.opencontainers.image.revision={{ .FullCommit }}
      - --label=org.opencontainers.image.licenses=MIT
    dockerfile: Dockerfile
    use: buildx
  - image_templates:
      - "docker.io/charmcli/soft-serve:latest-arm64"
      - "docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-arm64"
      - "docker.io/charmcli/soft-serve:v{{ .Version }}-arm64"
      - "ghcr.io/charmbracelet/soft-serve:latest-arm64"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-arm64"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-arm64"
    ids: [soft-serve]
    goarch: arm64
    build_flag_templates:
      - --platform=linux/arm64
      - --label=org.opencontainers.image.title={{ .ProjectName }}
      - --label=org.opencontainers.image.description={{ .ProjectName }}
      - --label=org.opencontainers.image.url=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.source=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.version=v{{ .Version }}
      - --label=org.opencontainers.image.created={{ .Date }}
      - --label=org.opencontainers.image.revision={{ .FullCommit }}
      - --label=org.opencontainers.image.licenses=MIT
    dockerfile: Dockerfile
    use: buildx
  - image_templates:
      - "docker.io/charmcli/soft-serve:latest-armv6"
      - "docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-armv6"
      - "docker.io/charmcli/soft-serve:v{{ .Version }}-armv6"
      - "ghcr.io/charmbracelet/soft-serve:latest-armv6"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-armv6"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-armv6"
    ids: [soft-serve]
    goarch: arm
    goarm: "6"
    build_flag_templates:
      - --platform=linux/arm/v6
      - --label=org.opencontainers.image.title={{ .ProjectName }}
      - --label=org.opencontainers.image.description={{ .ProjectName }}
      - --label=org.opencontainers.image.url=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.source=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.version=v{{ .Version }}
      - --label=org.opencontainers.image.created={{ .Date }}
      - --label=org.opencontainers.image.revision={{ .FullCommit }}
      - --label=org.opencontainers.image.licenses=MIT
    dockerfile: Dockerfile
    use: buildx
  - image_templates:
      - "docker.io/charmcli/soft-serve:latest-armv7"
      - "docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-armv7"
      - "docker.io/charmcli/soft-serve:v{{ .Version }}-armv7"
      - "ghcr.io/charmbracelet/soft-serve:latest-armv7"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-armv7"
      - "ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-armv7"
    ids: [soft-serve]
    goarch: arm
    goarm: "7"
    build_flag_templates:
      - --platform=linux/arm/v7
      - --label=org.opencontainers.image.title={{ .ProjectName }}
      - --label=org.opencontainers.image.description={{ .ProjectName }}
      - --label=org.opencontainers.image.url=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.source=https://github.com/charmbracelet/soft-serve
      - --label=org.opencontainers.image.version=v{{ .Version }}
      - --label=org.opencontainers.image.created={{ .Date }}
      - --label=org.opencontainers.image.revision={{ .FullCommit }}
      - --label=org.opencontainers.image.licenses=MIT
    dockerfile: Dockerfile
    use: buildx

docker_manifests:
  - name_template: docker.io/charmcli/soft-serve:latest
    image_templates:
      - docker.io/charmcli/soft-serve:latest-amd64
      - docker.io/charmcli/soft-serve:latest-arm64
      - docker.io/charmcli/soft-serve:latest-armv6
      - docker.io/charmcli/soft-serve:latest-armv7
      - docker.io/charmcli/soft-serve:latest-i386
  - name_template: ghcr.io/charmbracelet/soft-serve:latest
    image_templates:
      - ghcr.io/charmbracelet/soft-serve:latest-amd64
      - ghcr.io/charmbracelet/soft-serve:latest-arm64
      - ghcr.io/charmbracelet/soft-serve:latest-armv6
      - ghcr.io/charmbracelet/soft-serve:latest-armv7
      - ghcr.io/charmbracelet/soft-serve:latest-i386
  - name_template: docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}
    image_templates:
      - docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-amd64
      - docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-arm64
      - docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-armv6
      - docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-armv7
      - docker.io/charmcli/soft-serve:v{{ .Major }}.{{ .Minor }}-i386
  - name_template: ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}
    image_templates:
      - ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-amd64
      - ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-arm64
      - ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-armv6
      - ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-armv7
      - ghcr.io/charmbracelet/soft-serve:v{{ .Major }}.{{ .Minor }}-i386
  - name_template: docker.io/charmcli/soft-serve:v{{ .Version }}
    image_templates:
      - docker.io/charmcli/soft-serve:v{{ .Version }}-amd64
      - docker.io/charmcli/soft-serve:v{{ .Version }}-arm64
      - docker.io/charmcli/soft-serve:v{{ .Version }}-armv6
      - docker.io/charmcli/soft-serve:v{{ .Version }}-armv7
      - docker.io/charmcli/soft-serve:v{{ .Version }}-i386
  - name_template: ghcr.io/charmbracelet/soft-serve:v{{ .Version }}
    image_templates:
      - ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-amd64
      - ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-arm64
      - ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-armv6
      - ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-armv7
      - ghcr.io/charmbracelet/soft-serve:v{{ .Version }}-i386