name: Release nightly

on:
  workflow_dispatch:
  schedule:
    - cron: 0 0 * * *
jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - name: Set up Go
        uses: actions/setup-go@v6
        with:
          go-version: 1.25.x

      - name: Run GoReleaser
        uses: goreleaser/goreleaser-action@v6
        with:
          distribution: goreleaser-pro
          version: latest
          args: release --clean --nightly -f .goreleaser-nightly.yml
        env:
          GITHUB_TOKEN: ${{secrets.GH_PAT}}
          GORELEASER_KEY: ${{secrets.GORELEASER_KEY}}
          CLOUDSMITH_TOKEN: ${{secrets.CLOUDSMITH_TOKEN}}
