am-fs-core 0.2.2

Pure-Rust block-device framework — BlockRead/BlockDevice traits + FileDevice + CallbackDevice + LRU cache. Foundation crate for fs-* drivers and img-* containers.
Documentation
name: release

on:
  push:
    tags:
      - 'v*.*.*'

permissions:
  id-token: write
  contents: read

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: 1.95.0
          components: clippy
      - uses: Swatinem/rust-cache@v2

      - name: verify tag matches Cargo.toml version
        run: |
          tag="${GITHUB_REF_NAME#v}"
          crate_ver=$(grep -m1 '^version' Cargo.toml | sed -E 's/version *= *"(.*)"/\1/')
          if [ "$tag" != "$crate_ver" ]; then
            echo "tag $tag does not match Cargo.toml version $crate_ver" >&2
            exit 1
          fi

      - run: cargo test --all-targets
      - run: cargo clippy --all-targets -- -D warnings

  publish:
    name: publish to crates.io
    needs: test
    runs-on: ubuntu-latest
    environment: release
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: 1.95.0

      - uses: rust-lang/crates-io-auth-action@v1.0.4
        id: auth

      - name: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
        run: cargo publish