invoance 0.2.0

Official Rust SDK for the Invoance compliance API
Documentation
# Auto-publish to crates.io via Trusted Publishing (OIDC) when a tag matching
# `v*` is pushed. No CARGO_REGISTRY_TOKEN required.
#
# To release:
#   1. Bump `version` in Cargo.toml, update CHANGELOG.md, commit, push to main.
#   2. Tag and push:
#        git tag v0.1.0 -m "0.1.0"
#        git push origin v0.1.0
#   3. This workflow verifies the tag, tests, publishes, and cuts a Release.
#
# One-time crates.io Trusted Publishing setup:
#   1. Publish 0.1.0 once manually (crates.io requires the crate to exist before
#      a Trusted Publisher can be attached), OR reserve the name, then:
#   2. crates.io -> the `invoance` crate -> Settings -> Trusted Publishing -> add:
#        Repository owner: Invoance
#        Repository name:  invoance-rust
#        Workflow:         release.yml
#        Environment:      (leave blank, or `crates-io` if you create one)

name: Release to crates.io

on:
  push:
    tags:
      - "v*"

permissions:
  contents: write        # to create the GitHub Release
  id-token: write        # required for crates.io Trusted Publishing OIDC

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable

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

      - run: cargo test --all-targets
      - run: cargo publish --dry-run

      - name: Authenticate to crates.io via OIDC
        uses: rust-lang/crates-io-auth-action@v1
        id: auth

      - run: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

      - name: Create GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          name: ${{ github.ref_name }}
          generate_release_notes: true
          body: |
            See [CHANGELOG](CHANGELOG.md) for details.

            Published to https://crates.io/crates/invoance — add with `cargo add invoance`.