Skip to content

Commit beac19a

Browse files
committed
ci: build release body from CHANGELOG section instead of static link
publish.yml now extracts the tagged version's '## [x.y.z]' section from CHANGELOG.md into the release body (via body_path), appends the install instructions, and fails the release if no matching CHANGELOG section exists. CHANGELOG.md stays the single source of truth. Extraction + guard + heredoc dedent verified locally against the real file. CI-only; no version bump. Takes effect on the next tag; v3.4.0's page is unchanged.
1 parent b73f258 commit beac19a

2 files changed

Lines changed: 45 additions & 19 deletions

File tree

.github/workflows/publish.yml

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,52 @@ jobs:
4545
- name: Publish to npm
4646
run: npm publish --provenance --access public
4747

48+
- name: Generate release notes from CHANGELOG
49+
run: |
50+
VERSION="${GITHUB_REF_NAME#v}"
51+
# Extract this version's section body: everything between its
52+
# '## [x.y.z]' header and the next '## [' header, dropping the header
53+
# line itself, '---' rules, and leading blank lines.
54+
awk -v ver="$VERSION" '
55+
/^## \[/ { if (p) exit; if (index($0, "## [" ver "]") == 1) { p=1; next } }
56+
p {
57+
if ($0 == "---") next
58+
if (!seen && $0 ~ /^[[:space:]]*$/) next
59+
seen=1; print
60+
}
61+
' CHANGELOG.md > release_notes.md
62+
# Guard: never publish an empty body. A missing section means the tag
63+
# was cut without a matching CHANGELOG entry — fail so it gets fixed.
64+
if ! grep -q '[^[:space:]]' release_notes.md; then
65+
echo "::error::No CHANGELOG.md section found for version $VERSION. Add a '## [$VERSION]' entry before tagging."
66+
exit 1
67+
fi
68+
# Append install instructions below the changelog section.
69+
cat >> release_notes.md <<'EOF'
70+
71+
## Installation
72+
73+
**npm (interactive multi-agent installer):**
74+
```bash
75+
npm install -g @ckelsoe/prompt-architect
76+
npx @ckelsoe/prompt-architect
77+
```
78+
79+
**ChatGPT / Gemini CLI / Agent Skills:**
80+
Download `prompt-architect.skill` below and upload to your tool.
81+
82+
**Claude Code Plugin:**
83+
```
84+
/plugin marketplace add ckelsoe/prompt-architect
85+
/plugin install prompt-architect@prompt-architect-marketplace
86+
```
87+
EOF
88+
4889
- name: Create GitHub Release
4990
uses: softprops/action-gh-release@v3
5091
with:
5192
name: Release ${{ github.ref_name }}
5293
files: prompt-architect.skill
53-
body: |
54-
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details.
55-
56-
## Installation
57-
58-
**npm (interactive multi-agent installer):**
59-
```bash
60-
npm install -g @ckelsoe/prompt-architect
61-
npx @ckelsoe/prompt-architect
62-
```
63-
64-
**ChatGPT / Gemini CLI / Agent Skills:**
65-
Download `prompt-architect.skill` below and upload to your tool.
66-
67-
**Claude Code Plugin:**
68-
```
69-
/plugin marketplace add ckelsoe/prompt-architect
70-
/plugin install prompt-architect@prompt-architect-marketplace
71-
```
94+
body_path: release_notes.md
7295
draft: false
7396
prerelease: false

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
node_modules/
22
prompt-architect.skill
3+
4+
# Generated by publish.yml at release time
5+
release_notes.md

0 commit comments

Comments
 (0)