rootle 0.3.1

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 -e "VERSION=${GITHUB_REF_NAME#v}" release

      # Smoke: prove the tarball extracts to a static, runnable binary
      # and the published checksum matches.
      - name: Verify binary
        run: |
          cd dist
          sha256sum -c rootle-*.tar.gz.sha256
          tmp="$(mktemp -d)"
          tar -xzf rootle-*-x86_64-unknown-linux-musl.tar.gz -C "$tmp"
          bin="$(find "$tmp" -type f -name rootle | head -1)"
          file "$bin"
          ! ldd "$bin" 2>&1 | grep -q "=>"
          "$bin" --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