iris-reader 1.0.0

A terminal-native viewer for documents, structured data, images, PDFs, databases, and stdin.
Documentation
name: Publish Crate

on:
  release:
    types:
      - published

permissions:
  contents: read
  id-token: write

env:
  CARGO_TERM_COLOR: always

jobs:
  publish:
    name: Publish iris-reader
    runs-on: ubuntu-latest

    steps:
      - name: Checkout release
        uses: actions/checkout@v7
        with:
          ref: ${{ github.event.release.tag_name }}

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Verify release version
        shell: bash
        run: |
          TAG_VERSION="${{ github.event.release.tag_name }}"
          TAG_VERSION="${TAG_VERSION#v}"
          CARGO_VERSION="$(
            cargo metadata --no-deps --format-version 1 |
              jq -r '.packages[] | select(.name == "iris-reader") | .version'
          )"

          if [[ "$TAG_VERSION" != "$CARGO_VERSION" ]]; then
            echo "Release version: $TAG_VERSION"
            echo "Cargo version:   $CARGO_VERSION"
            exit 1
          fi

      - name: Authenticate with crates.io
        id: crates-io-auth
        uses: rust-lang/crates-io-auth-action@v1

      - name: Publish to crates.io
        run: cargo publish --locked
        env:
          CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }}