rootle 0.2.2

Modal TUI for browsing remote source-control systems (GitHub in-tree, any forge via stdio providers) from the terminal
Documentation
name: release

on:
  push:
    tags: ["v*"]

permissions:
  contents: write

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - name: Build static musl binary
        run: docker compose run --build --rm release

      # Smoke: prove the artifact is static and runs headless.
      - name: Verify binary
        run: |
          file dist/rootle-linux-x86_64-musl
          ! ldd dist/rootle-linux-x86_64-musl 2>&1 | grep -q "=>"
          ./dist/rootle-linux-x86_64-musl --version

      # crates.io before the GitHub release: it is the irreversible
      # artifact. The guard fails a mistagged release instead of
      # publishing the wrong version.
      - uses: dtolnay/rust-toolchain@stable

      - name: Publish to crates.io
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: |
          pkg="$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')"
          test "v$pkg" = "$GITHUB_REF_NAME" || {
            echo "::error::tag $GITHUB_REF_NAME != crate version v$pkg"; exit 1; }
          cargo publish

      - name: Create GitHub release
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          tag="${GITHUB_REF_NAME}"
          gh release create "$tag" dist/* \
            --title "rootle $tag" \
            --generate-notes