project_name: capsule
env:
  - COSIGN_EXPERIMENTAL=true
  - GO111MODULE=on
before:
  hooks:
    - go mod download
gomod:
  proxy: false
builds:
  - id: "{{ .ProjectName }}"
    main: ./cmd/controller
    binary: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
    env:
      - CGO_ENABLED=0
    goarch:
      - amd64
      - arm64
    goos:
      - linux
    flags:
      - -trimpath
    mod_timestamp: '{{ .CommitTimestamp }}'
    ldflags:
      - >-
        -X github.com/projectcapsule/capsule/internal/version.Version={{ .Tag }}
        -X github.com/projectcapsule/capsule/internal/version.GitCommit={{ .Commit }}
        -X github.com/projectcapsule/capsule/internal/version.GitTag={{ .Tag }}
        -X github.com/projectcapsule/capsule/internal/version.GitDirty={{ .Date }}
        -X github.com/projectcapsule/capsule/internal/version.BuildTime={{ .Date }}
        -X github.com/projectcapsule/capsule/internal/version.GitRepo={{ .ProjectName }}
  # - id: "{{ .ProjectName }}-wasm"
  #   main: ./cmd/
  #   binary: "{{ .ProjectName }}.wasm"
  #   env:
  #     - CGO_ENABLED=0
  #   goos:
  #   - js
  #   goarch:
  #   - wasm
  #   flags:
  #     - -trimpath
  #   mod_timestamp: '{{ .CommitTimestamp }}'
  #   ldflags:
  #     - >-
  #         -X main.Version={{ .Tag }}
  #         -X main.GitCommit={{ .Commit }}
  #         -X main.GitTag={{ .Tag }}
  #         -X main.GitDirty={{ .Date }}
  #         -X main.BuildTime={{ .Date }}
  #         -X main.GitRepo={{ .ProjectName }}
release:
  prerelease: auto
  footer: |
    **Full Changelog**: https://github.com/projectcapsule/{{ .ProjectName }}/compare/{{ .PreviousTag }}...{{ .Tag }}

    [Check out what's new in this release](https://projectcapsule.dev/docs/whats-new/)

    **Docker Images**
    - `ghcr.io/projectcapsule/{{ .ProjectName }}:{{ .Version }}`
    - `ghcr.io/projectcapsule/{{ .ProjectName }}:latest`

    **Helm Chart**
    View this release on [Artifact Hub](https://artifacthub.io/packages/helm/projectcapsule/capsule/{{ .Version }}) or use the OCI helm chart:

    - `ghcr.io/projectcapsule/charts/{{ .ProjectName }}:{{ .Version }}`

    [Review the Major Changes section first before upgrading to a new version](https://artifacthub.io/packages/helm/projectcapsule/capsule/{{ .Version }}#major-changes)

    > [!IMPORTANT]
    > **Kubernetes compatibility**
    >
    > Note that the Capsule project offers support only for the latest minor version of Kubernetes.
    > Backwards compatibility with older versions of Kubernetes and OpenShift is [offered by vendors](https://projectcapsule.dev/support/).
    >
    > | Kubernetes version | Minimum required |
    > |--------------------|------------------|
    > | `v1.36`            | `>= 1.36.0`      |


    Thanks to all the contributors! 🚀 🦄
checksum:
  name_template: 'checksums.txt'
changelog:
  sort: asc
  use: github
  filters:
    exclude:
    - '^test:'
    - '^chore'
    - '^rebase:'
    - 'merge conflict'
    - Merge pull request
    - Merge remote-tracking branch
    - Merge branch
  groups:
    # https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional
  - title: '🛠 Dependency updates'
    regexp: '^fix\(deps\):|^feat\(deps\):'
    order: 300
  - title: '✨ New Features'
    regexp: '^feat(\([^)]*\))?:'
    order: 100
  - title: '🐛 Bug fixes'
    regexp: '^fix(\([^)]*\))?:'
    order: 200
  - title: '📖 Documentation updates'
    regexp: '^docs(\([^)]*\))?:'
    order: 400
  - title: '🛡️ Security updates'
    regexp: '^sec(\([^)]*\))?:'
    order: 500
  - title: '🚀 Build process updates'
    regexp: '^(build|ci)(\([^)]*\))?:'
    order: 600
  - title: '📦 Other work'
    regexp: '^chore(\([^)]*\))?:|^chore:'
    order: 9999
sboms:
  - artifacts: archive
signs:
- cmd: cosign
  args:
  - "sign-blob"
  - "--output-signature=${signature}"
  - "${artifact}"
  - "--yes"
  artifacts: all
