rustis 0.22.0

Redis async driver for Rust
Documentation
name: Publish on crates.io

on:
  release:
    types: [published]
  # A release only emits `published` once, so a job that failed on an
  # infrastructure problem could not be retried without deleting and recreating
  # the release. Manual dispatch makes the publication replayable; pick the
  # release tag as the ref so the guard below still runs.
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
    steps:
    - name: Checkout sources
      uses: actions/checkout@v5
    # `Cargo.toml` is the version's source of truth: the bump is a reviewable
    # commit, and the tag only confirms it.
    #
    # Skipped when dispatched from a branch instead of a tag: there is no tag to
    # confirm anything, and comparing the manifest against a branch name would
    # fail on every such run.
    - name: Verify the tag matches Cargo.toml
      if: github.ref_type == 'tag'
      run: |
        # A command substitution that fails does not stop the script under
        # `set -e`, so an unreadable manifest would leave MANIFEST empty and
        # report a mismatch against nothing. `pipefail` and the emptiness test
        # make the guard say which of the two actually went wrong.
        set -o pipefail
        TAG=${{github.ref_name}}
        MANIFEST=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
        test -n "$MANIFEST" || { echo "::error::could not read the version from Cargo.toml"; exit 1; }
        if [ "$TAG" != "$MANIFEST" ]; then
          echo "::error::tag $TAG does not match Cargo.toml version $MANIFEST — bump the manifest and re-tag"
          exit 1
        fi
    - name: Publish crate
      run: cargo publish --token ${{secrets.CRATES_IO_API_TOKEN}}