ruststream 0.6.1

Async messaging framework for Rust: broker-agnostic traits, router, codecs, and a conformance harness for broker authors.
Documentation
name: Deploy docs

on:
  push:
    branches: [main]
    # Deliberately narrower than docs.yml: examples / snippet sources / Cargo.toml feed the
    # rendered site but must not trigger a deploy on their own, or a code-only merge after a
    # version bump would publish stale docs under the new version. A snippet-only change is
    # deployed by the next docs change or manually via workflow_dispatch.
    paths:
      - docs/**
      - properdocs.yml
      - overrides/**
  workflow_dispatch:

permissions:
  contents: write

concurrency:
  group: docs-deploy
  cancel-in-progress: false

jobs:
  deploy:
    name: Deploy versioned docs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
        with:
          fetch-depth: 0

      - uses: actions/setup-python@v7
        with:
          python-version: "3.12"

      - name: Install docs toolchain
        run: pip install -r docs/requirements.txt

      - name: Configure git
        run: |
          git config user.name "github-actions[bot]"
          git config user.email "github-actions[bot]@users.noreply.github.com"

      - name: Deploy with mike
        run: |
          version="$(sed -nE 's/^version = "([0-9]+)\.([0-9]+).*/\1.\2/p' Cargo.toml | head -1)"
          mike deploy --update-aliases "$version" latest
          mike set-default latest

      # mike records every deploy as a new commit on gh-pages, and each commit carries a full
      # copy of the rendered site, so the branch grows without bound (GitHub keeps the whole
      # history). Serving only needs the latest tree: rewrite the branch to a single commit
      # holding the current site and force-push, the same fix faststream applies to its docs
      # pipeline. mike itself only reads the branch tree (all deployed versions live side by
      # side in it), never the history, so squashing is invisible to the next deploy.
      - name: Squash gh-pages history and push
        run: |
          git checkout gh-pages
          git reset --hard "$(git commit-tree -m 'docs: deploy' 'HEAD^{tree}')"
          git push --force origin gh-pages