rust-mempool 0.0.5

A Rust Bindings for the Mempool API
Documentation
name: Release

on:
  push:
    tags:
      - "*"

jobs:
  ci:
    uses: ./.github/workflows/ci.yml
    secrets: inherit

  publish:
    name: Publish
    runs-on: ubuntu-latest
    needs:
      - ci
    permissions:
      contents: read
    steps:
      - name: Checkout sources
        uses: actions/checkout@v4

      - name: Install stable toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy

      - name: Cache dependencies
        uses: Swatinem/rust-cache@v2

      - name: Verify tag version matches Cargo.toml
        run: |
          CARGO_VERSION=$(grep -m1 'version = "' Cargo.toml | cut -d '"' -f2)
          TAG_VERSION=${GITHUB_REF#refs/tags/}
          TAG_VERSION=${TAG_VERSION#v}  # Remove 'v' prefix if present
          if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then
            echo "Version mismatch: Cargo.toml ($CARGO_VERSION) != tag ($TAG_VERSION)"
            exit 1
          fi

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