Skip to content

Commit d7371b2

Browse files
ci: create GitHub Release after npm version bump (#693)
Extends the release workflow to publish a GitHub Release using the generated CHANGELOG section as the release body, so each tag has a corresponding entry under the Releases page. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 9331273 commit d7371b2

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
git push --tags
4848
4949
- name: Update CHANGELOG
50+
id: changelog
5051
run: |
5152
VERSION_TAG=$(git describe --tags --abbrev=0)
5253
ENTRY=$(bash scripts/generate-changelog.sh "$VERSION_TAG")
@@ -60,6 +61,22 @@ jobs:
6061
git add CHANGELOG.md
6162
git commit -m "docs: update CHANGELOG.md for ${VERSION_TAG}"
6263
git push
64+
echo "version_tag=${VERSION_TAG}" >> "$GITHUB_OUTPUT"
65+
# Strip the leading "## vX.Y.Z" header line so the release body starts with the section content
66+
BODY=$(printf '%s\n' "$ENTRY" | tail -n +2)
67+
{
68+
echo 'body<<__CHANGELOG_EOF__'
69+
echo "$BODY"
70+
echo '__CHANGELOG_EOF__'
71+
} >> "$GITHUB_OUTPUT"
72+
73+
- name: Create GitHub Release
74+
env:
75+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
run: |
77+
gh release create "${{ steps.changelog.outputs.version_tag }}" \
78+
--title "${{ steps.changelog.outputs.version_tag }}" \
79+
--notes "${{ steps.changelog.outputs.body }}"
6380
6481
- name: Build project
6582
run: npm run build

0 commit comments

Comments
 (0)