knust 0.1.1

Asynchronous KNX/IP library for Rust
Documentation
name: Release
on:
  push:
    tags:
      - "v*.*.*"

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      # The tag is the source of truth for the published version: rewrite
      # Cargo.toml's version in this checkout (not committed back to git).
      - name: Set version from tag
        env:
          TAG_VERSION_RAW: ${{ github.ref_name }}
        run: |
          export TAG_VERSION="${TAG_VERSION_RAW#v}"
          perl -i -pe 's/^version = ".*"$/version = "$ENV{TAG_VERSION}"/' Cargo.toml
      # The tagged commit is expected to already have passed ci.yml (fmt,
      # clippy, tests, feature matrix, audit) via its PR. This is a safety
      # net, not a substitute.
      - run: cargo test --all-features
      - name: Publish to crates.io
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        # --allow-dirty: the version rewrite above is intentionally left
        # uncommitted (see "Set version from tag").
        run: cargo publish --all-features --allow-dirty