entromatica 2.3.0

Entromatica is a library for constructing, simulating and analyzing markov chains.
Documentation
on:
  push:
    branches:
      - main
name: release-please
env:
  BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
  lint-and-test:
    name: Run tests, lint
    runs-on: ubuntu-latest
    permissions: write-all
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          persist-credentials: false

      - name: Install rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          components: rustfmt, clippy
          profile: minimal
          override: true

      - uses: Swatinem/rust-cache@v2

      - name: cargo clippy
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --workspace --all-features --all-targets -- -D warnings --allow deprecated
      - name: test
        run: cargo test

  release-please:
    permissions:
      contents: write
      pull-requests: write
    runs-on: ubuntu-latest
    needs: lint-and-test
    steps:
      - name: Release Please
        uses: google-github-actions/release-please-action@v3
        id: release
        with:
          release-type: rust
          bump-minor-pre-major: true
          bump-patch-for-minor-pre-major: true
          package-name: entromatica

      - name: Checkout
        if: ${{ steps.release.outputs.release_created }}
        uses: actions/checkout@v3
        with:
          persist-credentials: false

      - name: Install rust
        uses: actions-rs/toolchain@v1
        if: ${{ steps.release.outputs.release_created }}
        with:
          toolchain: stable
          profile: minimal
          override: true

      - name: Cache
        uses: Swatinem/rust-cache@v2
        if: ${{ steps.release.outputs.release_created }}

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