name: snapshot

on:
  push:
    branches:
      - main

permissions:
  contents: read

concurrency:
  group: snapshot-${{ github.ref }}
  cancel-in-progress: true

jobs:
  snapshot:
    runs-on:
      # Use our own large runners with more CPU and RAM for faster builds
      group: releasers
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          fetch-depth: 0
          persist-credentials: false
      - uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
        with:
          go-version-file: go.mod
      - uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
        with:
          version: "~> v2"
          distribution: goreleaser-pro
          args: build --snapshot --clean
        env:
          GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
