nojson 0.3.13

A flexible Rust JSON library with no dependencies, no macros, no unsafe and optional no_std support
Documentation
name: Create GitHub Release and Publish to crates.io

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

jobs:
  validate:
    name: Validate release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - run: rustup update stable
      - run: rustup default stable
      - run: rustup component add rustfmt clippy
      # Guard against a `v*` tag whose name does not match Cargo.toml.
      # Without this, a tag like `v0.3.13` pushed against a workspace
      # still on `version = "0.3.12"` would silently publish 0.3.12 to
      # crates.io while the GitHub Release advertised v0.3.13.
      # `cargo metadata + jq` is preferred over `cargo pkgid | sed` so
      # a future change to cargo's pkgid output format cannot silently
      # break the check. `jq` is preinstalled on ubuntu-latest.
      - name: Tag matches Cargo.toml version
        run: |
          set -euo pipefail
          tag_version="${GITHUB_REF_NAME#v}"
          cargo_version="$(cargo metadata --format-version=1 --no-deps \
            | jq -r '.packages[] | select(.name == "nojson") | .version')"
          if [ "$tag_version" != "$cargo_version" ]; then
            echo "tag version ($tag_version) does not match Cargo.toml version ($cargo_version)"
            exit 1
          fi
      # The `validate` job re-runs the CI suite so a broken commit
      # that somehow received a `v*` tag never publishes, even if the
      # push-time CI on that commit failed or was skipped.
      - run: cargo test --all --lib --bins --tests --examples
      - run: cargo test --doc
      - run: cargo fmt --all -- --check
      - run: cargo clippy --all --all-targets -- -D warnings
      - run: cargo check --no-default-features
      - run: cargo test --no-default-features
      - run: cargo clippy --no-default-features --all-targets -- -D warnings
      - env:
          RUSTDOCFLAGS: -D warnings
        run: cargo doc --no-deps
      # Packaging smoke test: exercises manifest metadata, include /
      # exclude, readme path, and the verify pass in a clean copy.
      - run: cargo publish --dry-run

  github-release:
    needs: validate
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - id: create-release
        run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --generate-notes
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  publish:
    needs: github-release
    runs-on: ubuntu-latest
    permissions:
      id-token: write
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5
        id: auth
      - run: cargo publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}