cache-kit 0.9.0

A type-safe, fully generic, production-ready caching framework for Rust
Documentation
name: Release

on:
  push:
    tags:
      - "v*"

permissions:
  contents: read

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6

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

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

  create-release:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Checkout
        uses: actions/checkout@v6

      - name: Extract changelog
        id: changelog
        run: |
          VERSION=${GITHUB_REF#refs/tags/v}
          # Extract section for this version from CHANGELOG.md
          sed -n "/^## \[$VERSION\]/,/^## \[/p" CHANGELOG.md | sed '$d' > release_notes.txt

      - name: Create Release
        uses: softprops/action-gh-release@v1
        with:
          body_path: release_notes.txt
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}