rust-ml 0.1.5

A collection of machine learning algorithms implemented in pure Rust (personal project for practice).
Documentation
name: Publish to crates.io

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

jobs:
  publish:
    name: Publish Crate
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

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

      - name: Verify version
        run: |
          VERSION=${GITHUB_REF#refs/tags/v}
          TOML_VERSION=$(grep -m1 'version = "' Cargo.toml | sed -e 's/version = "//' -e 's/"//')

          if [ "$VERSION" != "$TOML_VERSION" ]; then
            echo "Tag version ($VERSION) doesn't match Cargo.toml version ($TOML_VERSION)"
            exit 1
          fi

      - name: Run tests
        run: cargo test --all-features

      - name: Publish to crates.io
        run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}