name: "release"

on:
  pull_request:
  push:
    tags:
      - "*"

jobs:
  draft:
    runs-on: "ubuntu-latest"
    permissions:
      contents: "write"
      packages: "write"
      id-token: "write"
    steps:
      - uses: "actions/checkout@v4"
      - run: |
          sudo apt-get install pandoc
      - uses: "sigstore/cosign-installer@v3"
      - uses: "anchore/sbom-action/download-syft@v0"
      - uses: "docker/setup-qemu-action@v3"
      - uses: "docker/setup-buildx-action@v3"
      - uses: docker/login-action@v3
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - uses: "actions/setup-go@v5"
        with:
          go-version: "1.26"
      - uses: "goreleaser/goreleaser-action@v6"
        with:
          distribution: "goreleaser"
          version: "~> v2"
          args: "release --clean"
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
