name: Publish Crates.io package

on:
  push:
    branches: [main]

jobs:
  publish:
    runs-on: ubuntu-latest
    name: Publish to Crates.io
    steps:
      - uses: actions/checkout@v4

      - uses: dtolnay/rust-toolchain@1.73

      - name: Run release-plz
        uses: MarcoIeni/release-plz-action@v0.5
        with:
          command: release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
