name: CD # Continuous Deployment

on:
  push:
    tags:
      - '[v]?[0-9]+.[0-9]+.[0-9]+'

jobs:

  publish-cargo:
    name: Publishing to Cargo
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
