docs: add 0.2.1 release notes #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*.*.*" | |
| workflow_dispatch: | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Validate plugin metadata JSON | |
| run: | | |
| jq empty .claude-plugin/plugin.json | |
| jq empty .claude-plugin/marketplace.json | |
| - name: Check plugin and marketplace versions match | |
| run: | | |
| plugin_version="$(jq -r '.version' .claude-plugin/plugin.json)" | |
| marketplace_version="$(jq -r '.plugins[] | select(.name == "pr-review") | .version' .claude-plugin/marketplace.json)" | |
| test "$plugin_version" = "$marketplace_version" | |
| - name: Validate changelog has current version section | |
| run: | | |
| plugin_version="$(jq -r '.version' .claude-plugin/plugin.json)" | |
| grep -q "^## \\[$plugin_version\\]" CHANGELOG.md | |
| - name: Validate review scripts | |
| run: bash -n skills/pr-review/scripts/*.sh | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: validate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Verify tag matches plugin version | |
| run: | | |
| tag="${GITHUB_REF_NAME#v}" | |
| plugin_version="$(jq -r '.version' .claude-plugin/plugin.json)" | |
| test "$tag" = "$plugin_version" | |
| - name: Extract release notes from changelog | |
| id: changelog | |
| run: | | |
| tag="${GITHUB_REF_NAME#v}" | |
| section="$(awk -v ver="$tag" ' | |
| $0 ~ "^## \\[" ver "\\]" {flag=1; next} | |
| flag && $0 ~ "^## \\[" {exit} | |
| flag {print} | |
| ' CHANGELOG.md)" | |
| release_title="$(printf '%s\n' "$section" | sed -n 's/^> Release title: //p' | head -n 1)" | |
| if [ -z "$release_title" ]; then | |
| release_title="$GITHUB_REF_NAME" | |
| else | |
| release_title="$GITHUB_REF_NAME - $release_title" | |
| fi | |
| printf 'release_name=%s\n' "$release_title" >> "$GITHUB_OUTPUT" | |
| printf '%s\n' "$section" | sed '/^> Release title: /d' | sed '/^[[:space:]]*$/N;/^\n$/D' > RELEASE_NOTES.md | |
| test -s RELEASE_NOTES.md | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ${{ steps.changelog.outputs.release_name }} | |
| body_path: RELEASE_NOTES.md |