serde-structprop 0.1.0

Serde serializer and deserializer for the structprop config file format
Documentation
name: Release

on:
  push:
    tags:
      - "v[0-9]*.[0-9]*.[0-9]*"

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings"

jobs:
  # -------------------------------------------------------------------------
  # Gate: all CI checks must pass before we publish anything.
  # -------------------------------------------------------------------------
  ci:
    name: CI checks
    uses: ./.github/workflows/ci.yml

  # -------------------------------------------------------------------------
  # Publish to crates.io and create a GitHub release.
  # -------------------------------------------------------------------------
  publish:
    name: Publish
    runs-on: ubuntu-latest
    needs: ci
    permissions:
      contents: write

    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0

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

      - name: Cache dependencies
        uses: Swatinem/rust-cache@v2

      - name: Install cocogitto
        uses: cocogitto/cocogitto-action@v3
        with:
          check: false

      - name: Generate release notes for this tag
        id: changelog
        run: |
          # Extract the version from the tag (strip leading 'v').
          VERSION="${GITHUB_REF_NAME#v}"
          # Write release notes outside the repo so cargo publish --locked
          # does not see an untracked file and refuse to run.
          cog changelog --at "$GITHUB_REF_NAME" > /tmp/release_notes.md || \
            echo "No structured changelog available for $GITHUB_REF_NAME." > /tmp/release_notes.md
          echo "version=$VERSION" >> "$GITHUB_OUTPUT"

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

      - name: Create GitHub release
        run: |
          gh release create "$GITHUB_REF_NAME" \
            --title "$GITHUB_REF_NAME" \
            --notes-file /tmp/release_notes.md
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}