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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
        with:
          fetch-depth: 0
          persist-credentials: false
      - uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
        with:
          go-version-file: go.mod
      - uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
        with:
          version: "~> v2"
          distribution: goreleaser-pro
          args: build --snapshot --clean
        env:
          GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
