moadim 0.12.0

Moadim.io MCP/REST server for managing cron jobs
name: GitHub Release

# Cut a GitHub Release whenever a `v*` tag is pushed (same trigger that drives
# the crates.io publish in publish.yml). Release notes are extracted from the
# matching version section in CHANGELOG.md so the published notes stay in sync
# with the changelog. Runs independently of publish.yml — neither blocks the
# other.

on:
  push:
    tags:
      - 'v*'

permissions:
  contents: write

jobs:
  release:
    name: Create GitHub Release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - name: Extract changelog section for this tag
        id: notes
        run: |
          VERSION=${GITHUB_REF_NAME#v}
          # Pull lines between '## [VERSION]' and the next '## [' heading.
          awk -v ver="$VERSION" '
            $0 ~ "^## \\[" ver "\\]" { capture=1; next }
            capture && /^## \[/ { exit }
            capture { print }
          ' CHANGELOG.md > release-notes.md
          if [ ! -s release-notes.md ]; then
            echo "No changelog section found for [$VERSION]" >&2
            exit 1
          fi
          echo "Release notes for $VERSION:"
          cat release-notes.md

      - name: Create release
        uses: softprops/action-gh-release@v2
        with:
          name: ${{ github.ref_name }}
          body_path: release-notes.md