@@ -172,7 +172,6 @@ jobs:
172172 script : |
173173 const fs = require('fs');
174174 const diff = fs.readFileSync('/tmp/diff.txt', 'utf8');
175- const existingUpdates = fs.readFileSync('docs/vectoriadb/updates.mdx', 'utf8');
176175 const releaseDate = new Date().toISOString().split('T')[0];
177176 const version = process.env.VERSION;
178177 const versionNum = version.replace('v', '');
@@ -231,51 +230,18 @@ jobs:
231230 core.setOutput('changelog', result.changelog);
232231 core.setOutput('has_card_mdx', result.cardMdx ? 'true' : 'false');
233232
234- - name : Update CHANGELOG.md
235- if : ${{ inputs.dry_run != true && inputs.release_type == 'stable' && steps.ai_changelog.outputs.changelog }}
236- run : |
237- node -e "
238- const fs = require('fs');
239- const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
240- const newEntry = process.env.CHANGELOG_ENTRY;
241- const lines = changelog.split('\n');
242- const unreleasedIdx = lines.findIndex(l => l.startsWith('## [Unreleased]'));
243- let insertIdx = unreleasedIdx + 1;
244- while (insertIdx < lines.length && !lines[insertIdx].match(/^## \[\d/)) insertIdx++;
245- if (lines[insertIdx - 1].trim() !== '') { lines.splice(insertIdx, 0, ''); insertIdx++; }
246- lines.splice(insertIdx, 0, newEntry);
247- fs.writeFileSync('CHANGELOG.md', lines.join('\n'));
248- "
249- env :
250- CHANGELOG_ENTRY : ${{ steps.ai_changelog.outputs.changelog }}
251-
252- - name : Update updates.mdx
253- if : ${{ inputs.dry_run != true && inputs.release_type == 'stable' && steps.ai_changelog.outputs.has_card_mdx == 'true' }}
254- run : |
255- node scripts/update-docs-changelog.mjs \
256- --version "v${{ steps.version.outputs.version }}" \
257- --version-minor "${{ steps.context.outputs.release_line }}" \
258- --card-mdx-file "/tmp/card-mdx.txt"
259-
260233 - name : Update package version
261234 if : ${{ inputs.dry_run != true }}
262235 run : |
263236 npx nx release version "${{ steps.version.outputs.version }}" \
264237 --projects=vectoriadb --git-tag=false --git-commit=false
265238
266- - name : Commit version bump and docs
239+ - name : Commit version bump
267240 if : ${{ inputs.dry_run != true }}
268241 run : |
269242 if [ -n "$(git status --porcelain)" ]; then
270243 git add -A
271- git commit -m "$(cat <<'EOF'
272- chore(release): v${{ steps.version.outputs.version }}
273-
274- - Bump version to ${{ steps.version.outputs.version }}
275- - Update CHANGELOG.md
276- - Update docs/vectoriadb/updates.mdx
277- EOF
278- )"
244+ git commit -m "chore(release): v${{ steps.version.outputs.version }}"
279245 git push origin HEAD
280246 fi
281247
@@ -315,28 +281,69 @@ jobs:
315281
316282 echo "Created and pushed tag: $TAG"
317283
284+ - name : Prepare release body
285+ id : release_body
286+ env :
287+ CHANGELOG : ${{ steps.ai_changelog.outputs.changelog }}
288+ run : |
289+ VERSION="${{ steps.version.outputs.version }}"
290+ RELEASE_TYPE="${{ steps.version.outputs.release_type }}"
291+ RELEASE_LINE="${{ steps.context.outputs.release_line }}"
292+ BRANCH="${{ steps.context.outputs.branch }}"
293+ IS_PRERELEASE="${{ steps.version.outputs.is_prerelease }}"
294+
295+ # Start building the release body
296+ {
297+ echo "## Release v${VERSION}"
298+ echo ""
299+ echo "**Release type:** ${RELEASE_TYPE}"
300+ echo "**Release line:** ${RELEASE_LINE}.x"
301+ echo "**Branch:** ${BRANCH}"
302+ } > /tmp/release-body.md
303+
304+ # Add AI-generated changelog if available
305+ if [ -f /tmp/card-mdx.txt ] && [ -s /tmp/card-mdx.txt ] && [ -n "$CHANGELOG" ]; then
306+ echo "" >> /tmp/release-body.md
307+ echo "$CHANGELOG" >> /tmp/release-body.md
308+ fi
309+
310+ # Add installation section
311+ {
312+ echo ""
313+ echo "### Installation"
314+ echo ""
315+ echo '```bash'
316+ echo "npm install vectoriadb@${VERSION}"
317+ echo '```'
318+ } >> /tmp/release-body.md
319+
320+ # Add pre-release note if applicable
321+ if [ "$IS_PRERELEASE" = "true" ]; then
322+ echo "" >> /tmp/release-body.md
323+ echo "> **Note:** This is a pre-release version." >> /tmp/release-body.md
324+ fi
325+
326+ # Add Card MDX as hidden comment for docs sync (only for stable releases)
327+ # NOTE: Content is sanitized to prevent --> from breaking the HTML comment.
328+ # Consumer must reverse: replace "-->" with "-->" after extraction.
329+ if [ -f /tmp/card-mdx.txt ] && [ -s /tmp/card-mdx.txt ]; then
330+ echo "" >> /tmp/release-body.md
331+ echo "<!--" >> /tmp/release-body.md
332+ echo "CARD_MDX_START" >> /tmp/release-body.md
333+ sed 's/-->/--\>/g' /tmp/card-mdx.txt >> /tmp/release-body.md
334+ echo "CARD_MDX_END" >> /tmp/release-body.md
335+ echo "-->" >> /tmp/release-body.md
336+ fi
337+
318338 - name : Create GitHub Release
319339 if : ${{ inputs.dry_run != true }}
320340 uses : softprops/action-gh-release@v2
321341 with :
322342 tag_name : v${{ steps.version.outputs.version }}
323343 name : v${{ steps.version.outputs.version }}
324344 prerelease : ${{ steps.version.outputs.is_prerelease }}
325- generate_release_notes : true
326- body : |
327- ## Release v${{ steps.version.outputs.version }}
328-
329- **Release type:** ${{ steps.version.outputs.release_type }}
330- **Release line:** ${{ steps.context.outputs.release_line }}.x
331- **Branch:** ${{ steps.context.outputs.branch }}
332-
333- ### Installation
334-
335- ```bash
336- npm install vectoriadb@${{ steps.version.outputs.version }}
337- ```
338-
339- ${{ steps.version.outputs.is_prerelease == 'true' && '> **Note:** This is a pre-release version.' || '' }}
345+ generate_release_notes : false
346+ body_path : /tmp/release-body.md
340347 env :
341348 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
342349
0 commit comments