Merge pull request #12 from neilgfoster/006-inbox-scope #5
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 | |
| # Cut a GitHub Release from a vX.Y.Z tag. The version in | |
| # plugin/.claude-plugin/plugin.json is the single source of truth; this workflow refuses to | |
| # release if the tag and that version disagree, then publishes notes from CHANGELOG.md. | |
| on: | |
| push: | |
| tags: ["v*.*.*"] | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Verify tag matches plugin.json version | |
| run: | | |
| tag="${GITHUB_REF_NAME#v}" | |
| ver=$(python3 -c "import json; print(json.load(open('plugin/.claude-plugin/plugin.json'))['version'])") | |
| if [ "$tag" != "$ver" ]; then | |
| echo "tag $GITHUB_REF_NAME does not match plugin.json version $ver" >&2 | |
| exit 1 | |
| fi | |
| - name: Extract release notes from CHANGELOG | |
| run: | | |
| ver="${GITHUB_REF_NAME#v}" | |
| awk -v v="$ver" ' | |
| $0 ~ "^## \\[" v "\\]" {grab=1; next} | |
| grab && /^## \[/ {exit} | |
| grab {print} | |
| ' CHANGELOG.md > RELEASE_NOTES.md | |
| if [ ! -s RELEASE_NOTES.md ]; then | |
| echo "No CHANGELOG section for $ver." > RELEASE_NOTES.md | |
| fi | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --notes-file RELEASE_NOTES.md |