project_name: soft-serve

env:
  - GO111MODULE=on
  - CGO_ENABLED=0

before:
  hooks:
    - go mod download

builds:
  - id: "soft-serve"
    binary: "soft-serve"
    ldflags: -s -w -X main.Version={{ .Commit }}-snapshot -X main.CommitSHA={{ .Commit }}
    goos:
      - linux
    goarch:
      - amd64

dockers:
  - image_templates:
      - "ghcr.io/charmbracelet/soft-serve-internal:snapshot"
      - "ghcr.io/charmbracelet/soft-serve-internal:{{ .Commit }}-snapshot"
    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-internal
      - --label=org.opencontainers.image.source=https://github.com/charmbracelet/soft-serve-internal
      - --label=org.opencontainers.image.version={{ .Commit }}-snapshot
      - --label=org.opencontainers.image.created={{ .Date }}
      - --label=org.opencontainers.image.revision={{ .FullCommit }}
      - --label=org.opencontainers.image.licenses=MIT
    dockerfile: Dockerfile
    use: buildx
