crypto-pay-api 0.2.1

A Rust client library for Crypto Pay API provided by Telegram CryptoBot
Documentation
name: Release

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

env:
  CARGO_TERM_COLOR: always

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

  publish:
    needs: test
    name: Publish to crates.io
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: Verify versions match
        run: |
          CARGO_VERSION=$(cargo pkgid | cut -d# -f2)
          TAG_VERSION=${GITHUB_REF#refs/tags/v}
          if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then
            echo "Version mismatch: Cargo.toml ($CARGO_VERSION) != Tag ($TAG_VERSION)"
            exit 1
          fi
      - name: Build release
        run: cargo build --release --all-features

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

      - name: Create GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          generate_release_notes: true