name: RustDeploy

on:
  push:
    branches: [master, main]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust: [stable]
    steps:
      - uses: actions/checkout@v4
      - uses: hecrj/setup-rust-action@v2
        with:
          rust-version: ${{ matrix.rust }}
      - name: Build
        run: cargo build --verbose
      - name: Run tests
        run: cargo test --verbose
      - name: Document
        run: cargo doc
      - name: Publish
        run: cargo publish --token ${{ secrets.CARGO_TOKEN }} --allow-dirty || true
