name: Release Crates

on:
  push:
    branches:
      - main
  workflow_dispatch:

# release-plz is not safe to run concurrently against the same repo state.
concurrency:
  group: release-plz
  cancel-in-progress: false

jobs:
  release-crates:
    name: Release Crates
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      id-token: write
    steps:
      - name: Checkout code
        uses: actions/checkout@v6
        with:
          fetch-depth: 0
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Run release-plz
        uses: release-plz/action@1efcf74dfcd6e500990dad806e286899ae384064 # v0.5.119
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
