pulse-client 2.6.0

Official Rust client for StreamFlow Pulse — AI Agent Platform
Documentation
name: Release to crates.io

# Lives at .github/workflows/release.yaml in olsisoft/pulse-rs.
# Triggered by tag push (v*). Runs tests then publishes the crate.
#
# Required secret: CARGO_REGISTRY_TOKEN (crates.io account → API tokens →
# scope: publish-new + publish-update for the pulse-client crate).

on:
  push:
    tags:
      - 'v*'

permissions:
  contents: write   # for GitHub Release creation

jobs:
  release:
    runs-on: ubuntu-latest
    environment: crates-io   # configure in repo settings → environments
    steps:
      - uses: actions/checkout@v4

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

      - name: Cargo cache
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-release-${{ hashFiles('Cargo.toml') }}

      - name: Verify tag matches Cargo.toml version
        run: |
          tag_version="${GITHUB_REF_NAME#v}"
          crate_version=$(grep -E '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
          if [ "$tag_version" != "$crate_version" ]; then
            echo "::error::Tag ($tag_version) does not match Cargo.toml version ($crate_version)"
            exit 1
          fi

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

      - name: Dry-run publish (catches packaging issues early)
        run: cargo publish --dry-run

      - 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
          body: |
            Install: `cargo add pulse-client@${{ github.ref_name }}`