a9-prettyplease 0.1.7

A minimal `syn` syntax tree pretty-printer (fork of prettyplease with enhanced blank-line heuristics)
Documentation
name: Publish

on:
  push:
    tags:
      - "v*"

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: -Dwarnings

jobs:
  ci:
    uses: ./.github/workflows/ci.yml

  publish:
    name: Publish to crates.io
    needs: ci
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2

      - name: Verify tag matches Cargo.toml version
        run: |
          TAG="${GITHUB_REF_NAME}"
          CARGO_VERSION="v$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "a9-prettyplease") | .version')"
          if [ "$TAG" != "$CARGO_VERSION" ]; then
            echo "::error::Tag $TAG does not match Cargo.toml version $CARGO_VERSION"
            exit 1
          fi

      - name: Publish
        run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}