before:
  hooks:
    - go mod tidy
builds:
  - id: goldilocks
    ldflags:
      - -X main.version={{.Version}} -X main.commit={{.Commit}} -s -w
    goarch:
      - amd64
      - arm
      - arm64
    env:
      - CGO_ENABLED=0
      - GO111MODULE=on
    goos:
      - linux
      - darwin
    goarm:
      - 6
      - 7
changelog:
  sort: asc
  filters:
    exclude:
      - '^docs:'
      - '^test:'
release:
  prerelease: auto
  footer: |
    You can verify the signatures of both the checksums.txt file and the published docker images using [cosign](https://github.com/sigstore/cosign).

    ```
    sha256sum -c goldilocks_v{{ .Major }}.{{ .Minor }}.{{ .Patch }}_checksums.txt --ignore-missing
    cosign verify-blob goldilocks_v{{ .Major }}.{{ .Minor }}.{{ .Patch }}_checksums.txt --signature=goldilocks_v{{ .Major }}.{{ .Minor }}.{{ .Patch }}_checksums.txt.sig  --key https://artifacts.fairwinds.com/cosign.pub
    ```

    ```
    cosign verify us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v4 --key https://artifacts.fairwinds.com/cosign.pub
    ```
signs:
- cmd: cosign
  args: ["sign-blob", "--key=hashivault://cosign", "-output-signature=${signature}", "${artifact}"]
  artifacts: checksum

docker_signs:
- artifacts: all
  args: ["sign", "--key=hashivault://cosign", "${artifact}", "-r"]
dockers:
- image_templates:
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:{{ .FullCommit }}-amd64"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:{{ .Tag }}-amd64"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}-amd64"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}.{{ .Minor }}-amd64"
  use: buildx
  dockerfile: Dockerfile
  build_flag_templates:
  - "--platform=linux/amd64"
- image_templates:
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:{{ .Tag }}-arm64v8"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}-arm64v8"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}.{{ .Minor }}-arm64v8"
  use: buildx
  goarch: arm64
  dockerfile: Dockerfile
  build_flag_templates:
  - "--platform=linux/arm64/v8"
- image_templates:
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:{{ .Tag }}-armv7"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}-armv7"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}.{{ .Minor }}-armv7"
  use: buildx
  goarch: arm64
  dockerfile: Dockerfile
  build_flag_templates:
  - "--platform=linux/arm/v7"
docker_manifests:
- name_template: us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:{{ .Tag }}
  image_templates:
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:{{ .Tag }}-amd64"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:{{ .Tag }}-arm64v8"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:{{ .Tag }}-armv7"
- name_template: us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}
  image_templates:
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}-amd64"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}-arm64v8"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}-armv7"
- name_template: us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}.{{ .Minor }}
  image_templates:
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}.{{ .Minor }}-amd64"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}.{{ .Minor }}-arm64v8"
  - "us-docker.pkg.dev/fairwinds-ops/oss/goldilocks:v{{ .Major }}.{{ .Minor }}-armv7"
