Documentation
on:
  push:
    branches:
      - main
name: release-please
env:
  CARGO_TERM_COLOR: always
permissions:
  contents: write
  pull-requests: write
jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Build
        run: cargo build --verbose
      - name: Run tests
        run: |
          cargo fmt --all --check
          cargo build --locked --all-targets
          cargo build --locked --all-targets --all-features
          cargo clippy --locked --all-targets --all-features -- --deny warnings
          cargo test --all-targets --all-features

      - uses: googleapis/release-please-action@v4
        id: release

      - name: Publish
        run: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
        if: ${{ steps.release.outputs.release_created }}