Skip to content

Commit aed220d

Browse files
committed
CI: Remove frontmatter from release notes
1 parent 9e20a25 commit aed220d

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,13 @@ jobs:
313313
path: npm
314314
- name: Create npm workspace tarball
315315
run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js .
316-
- name: Parse semver for tag
316+
- uses: actions/setup-node@v4
317317
if: startsWith(github.ref, 'refs/tags/v')
318-
uses: madhead/semver-utils@v4
319-
id: semver
320318
with:
321-
version: ${{ github.ref_name }}
319+
node-version: "24"
320+
- name: Create release notes
321+
if: startsWith(github.ref, 'refs/tags/v')
322+
run: npm run package-release-notes
322323
- name: Create GitHub release for tag
323324
if: startsWith(github.ref, 'refs/tags/v')
324325
uses: ncipollo/release-action@v1
@@ -327,4 +328,4 @@ jobs:
327328
artifactContentType: application/x-xz
328329
prerelease: ${{ contains(github.ref, '-rc') }}
329330
makeLatest: ${{ !contains(github.ref, '-rc') }}
330-
bodyFile: "docs/src/content/docs/changelog/v${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}.${{ steps.semver.outputs.patch }}.md"
331+
bodyFile: release-notes.md

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ package-lock.json
1616
.firebase
1717
.astro
1818
docs/dist
19+
release-notes.md

npm/release-notes.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { readFileSync, writeFileSync } = require('node:fs');
2+
3+
const { version } = require('./package.json');
4+
const versionWithoutPreRelease = version.replace(/-rc\.\d+$/, '');
5+
6+
const markdown = readFileSync(`./docs/src/content/docs/changelog/v${versionWithoutPreRelease}.md`, 'utf8');
7+
const markdownWithoutFrontmatter = markdown.replace(/---\n.*?\n---\n+/s, '');
8+
9+
writeFileSync('./release-notes.md', markdownWithoutFrontmatter);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
"test-leak": "./test/leak/leak.sh",
102102
"test-types": "tsd",
103103
"package-from-local-build": "node npm/from-local-build.js",
104+
"package-release-notes": "node npm/release-notes.js",
104105
"docs-build": "node docs/build.mjs",
105106
"docs-serve": "cd docs && npm start",
106107
"docs-publish": "cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"

0 commit comments

Comments
 (0)