gproxy-protocol 1.0.20

Wire-format types and cross-protocol transforms for Claude, OpenAI, and Gemini LLM APIs.
Documentation
name: Release

on:
  release:
    types: [published]

jobs:
  publish:
    name: Publish to crates.io
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

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

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

      - name: Verify release tag matches Cargo.toml version
        run: |
          set -euo pipefail
          TAG="${GITHUB_REF_NAME#v}"
          CRATE_VER=$(awk -F\" '/^version[[:space:]]*=/ {print $2; exit}' Cargo.toml)
          echo "release tag = $GITHUB_REF_NAME"
          echo "crate version = $CRATE_VER"
          if [ "$TAG" != "$CRATE_VER" ]; then
            echo "::error::Release tag ($GITHUB_REF_NAME) does not match Cargo.toml version ($CRATE_VER)."
            exit 1
          fi

      - name: cargo publish --dry-run
        run: cargo publish --dry-run

      - name: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: cargo publish