before:
  hooks:
    - go mod tidy
    - go mod vendor
builds:
  -
    id: tfsec
    main: ./cmd/tfsec
    binary: tfsec
    ldflags:
    - "-X github.com/aquasecurity/tfsec/version.Version={{.Version}} -s -w -extldflags '-fno-PIC -static'"
    env:
      - CGO_ENABLED=0
      - GOFLAGS=-mod=vendor
    goos:
      - linux
      - windows
      - darwin
    goarch:
      - amd64
      - arm64

checksum:
  name_template: '{{ .ProjectName }}_checksums.txt'

snapshot:
  name_template: "{{ .Tag }}-next"

changelog:
  sort: asc
  filters:
    exclude:
      - '^docs:'
      - '^test:'

signs:
  - artifacts: binary
    signature: "${artifact}.D66B222A3EA4C25D5D1A097FC34ACEFB46EC39CE.sig"

archives:
  -
    format: binary
    name_template: "{{ .Binary}}-{{ .Os }}-{{ .Arch }}"

release:
  prerelease: auto
  github:
    owner: aquasecurity
    name: tfsec

dockers:
  - 
    goos: linux
    goarch: amd64
    ids:
    - tfsec

    dockerfile: Dockerfile
    skip_push: auto
    image_templates:
    - "aquasec/tfsec:latest"
    - "aquasec/tfsec:{{ .Tag }}"
    - "aquasec/tfsec:v{{ .Major }}.{{ .Minor }}"
    - "aquasec/tfsec-alpine:latest"
    - "aquasec/tfsec-alpine:{{ .Tag }}"
    - "aquasec/tfsec-alpine:v{{ .Major }}.{{ .Minor }}"
  - 
    goos: linux
    goarch: amd64
    ids:
    - tfsec

    dockerfile: Dockerfile.scratch
    skip_push: auto
    image_templates:
    - "aquasec/tfsec-scratch:latest"
    - "aquasec/tfsec-scratch:{{ .Tag }}"
    - "aquasec/tfsec-scratch:v{{ .Major }}.{{ .Minor }}"
  - 
    goos: linux
    goarch: amd64
    ids:
    - tfsec

    dockerfile: Dockerfile.ci
    skip_push: auto
    image_templates:
    - "aquasec/tfsec-ci:latest"
    - "aquasec/tfsec-ci:{{ .Tag }}"
    - "aquasec/tfsec-ci:v{{ .Major }}.{{ .Minor }}"

  - 
    goos: linux
    goarch: amd64
    ids:
    - tfsec

    dockerfile: Dockerfile
    image_templates:
    - "aquasec/tfsec:{{ .Tag }}"
    - "aquasec/tfsec-alpine:{{ .Tag }}"
  - 
    goos: linux
    goarch: amd64
    ids:
    - tfsec

    dockerfile: Dockerfile.scratch
    image_templates:
    - "aquasec/tfsec-scratch:{{ .Tag }}"
  - 
    goos: linux
    goarch: amd64
    ids:
    - tfsec

    dockerfile: Dockerfile.ci
    image_templates:
    - "aquasec/tfsec-ci:{{ .Tag }}"
