config_watcher 0.11.0

Config Watcher is a Rust library for tracking configuration items from files, Kubernetes ConfigMaps, and MQTT topics, providing real-time updates and structured data parsing.
Documentation
name: Publish to crates.io

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

jobs:
  publish:
    name: Publish to crates.io
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Set up Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Cache Cargo registry
        uses: actions/cache@v3
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
          key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: |
            cargo-${{ runner.os }}-

      - name: Verify crate version matches tag
        run: |
          VERSION_IN_CARGO_TOML=$(grep '^version =' Cargo.toml | cut -d '"' -f 2)
          VERSION_IN_TAG=${GITHUB_REF#refs/tags/v}
          if [ "$VERSION_IN_CARGO_TOML" != "$VERSION_IN_TAG" ]; then
            echo "Version in Cargo.toml ($VERSION_IN_CARGO_TOML) does not match tag ($VERSION_IN_TAG)"
            exit 1
          fi

      - name: Publish to crates.io
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
        run: cargo publish --allow-dirty