ironcrypt 0.1.0

A Rust library for secure password hashing, RSA key generation, and managing the encryption and verification of passwords and binary files.
Documentation
name: Publish Crate

on:
  push:
    tags:
      - 'v*.*.*'  # Déclenche la publication seulement sur les tags versionnés SemVer

jobs:
  publish:
    runs-on: ubuntu-latest

    container:
      image: rust:latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Set up Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true

      - name: Run tests
        run: cargo test --verbose

      - name: Build crate
        run: cargo build --release

      - name: Verify version string consistency
        run: |
          VERSION_TAG=${GITHUB_REF#refs/tags/}
          CARGO_VERSION=$(cargo pkgid | sed 's/.*#//')
          if [ "$VERSION_TAG" != "$CARGO_VERSION" ]; then
            echo "Version tag ($VERSION_TAG) does not match Cargo.toml version ($CARGO_VERSION)"
            exit 1
          fi

      - name: Publish crate to crates.io
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: cargo publish --registry crates-io