Skip to content

Commit 636a9e4

Browse files
committed
ci(release): use CHANGELOG.md for release notes
Extract release notes from CHANGELOG.md instead of auto-generating them. This ensures the GitHub Release shows our curated release notes with breaking change documentation and migration guides.
1 parent b9f38bf commit 636a9e4

1 file changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/prepare-release.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,45 @@ jobs:
100100
exit 1
101101
fi
102102
103+
- name: Extract release notes from CHANGELOG
104+
env:
105+
VERSION: ${{ inputs.version }}
106+
shell: bash
107+
run: |
108+
# Extract the section for this version from CHANGELOG.md
109+
# Matches from "## vX.Y.Z" until the next "## v" or "---" or end of file
110+
awk -v ver="$VERSION" '
111+
/^## v'"$VERSION"'/ { found=1; next }
112+
found && /^## v[0-9]/ { exit }
113+
found && /^---$/ { exit }
114+
found { print }
115+
' CHANGELOG.md > release-notes.md
116+
117+
# Verify we extracted something
118+
if [ ! -s release-notes.md ]; then
119+
echo "ERROR: Could not extract release notes for v${VERSION} from CHANGELOG.md"
120+
exit 1
121+
fi
122+
123+
echo "=== Extracted release notes ==="
124+
cat release-notes.md
125+
103126
- name: Create and publish release
104127
env:
105128
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
VERSION: ${{ inputs.version }}
130+
TARGET_REF: ${{ inputs.ref }}
131+
IS_PRERELEASE: ${{ inputs.prerelease }}
106132
shell: bash
107133
run: |
108-
TAG="v${{ inputs.version }}"
134+
TAG="v${VERSION}"
109135
FLAGS=""
110-
if [ "${{ inputs.prerelease }}" = "true" ]; then
136+
if [ "$IS_PRERELEASE" = "true" ]; then
111137
FLAGS="${FLAGS} --prerelease"
112138
fi
113139
114140
gh release create "${TAG}" \
115-
--target "${{ inputs.ref }}" \
116-
--title "${TAG}" \
117-
--generate-notes \
141+
--target "${TARGET_REF}" \
142+
--title "Version ${VERSION}" \
143+
--notes-file release-notes.md \
118144
${FLAGS}

0 commit comments

Comments
 (0)