name: Release

on:
  push:
    tags:
      - v*

jobs:
  publish-crates:
    runs-on: ubuntu-latest
    timeout-minutes: 360
    steps:
      - name: Checkout
        uses: actions/checkout@v6

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

      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install protobuf-compiler

      - uses: katyo/publish-crates@v2
        with:
          registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          ignore-unpublished-changes: true
          args: --locked --no-verify
