CI: Remove frontmatter from release notes

This commit is contained in:
Lovell Fuller 2025-07-26 23:58:48 +01:00
parent 9e20a25c5d
commit dda00f63e6
4 changed files with 17 additions and 5 deletions

View File

@ -313,12 +313,13 @@ jobs:
path: npm path: npm
- name: Create npm workspace tarball - name: Create npm workspace tarball
run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js . run: tar -vcaf npm-workspace.tar.xz --directory npm --exclude=from-local-build.js .
- name: Parse semver for tag - uses: actions/setup-node@v4
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
uses: madhead/semver-utils@v4
id: semver
with: with:
version: ${{ github.ref_name }} node-version: "24"
- name: Create release notes
if: startsWith(github.ref, 'refs/tags/v')
run: npm run package-release-notes
- name: Create GitHub release for tag - name: Create GitHub release for tag
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
uses: ncipollo/release-action@v1 uses: ncipollo/release-action@v1
@ -327,4 +328,4 @@ jobs:
artifactContentType: application/x-xz artifactContentType: application/x-xz
prerelease: ${{ contains(github.ref, '-rc') }} prerelease: ${{ contains(github.ref, '-rc') }}
makeLatest: ${{ !contains(github.ref, '-rc') }} makeLatest: ${{ !contains(github.ref, '-rc') }}
bodyFile: "docs/src/content/docs/changelog/v${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}.${{ steps.semver.outputs.patch }}.md" bodyFile: release-notes.md

1
.gitignore vendored
View File

@ -16,3 +16,4 @@ package-lock.json
.firebase .firebase
.astro .astro
docs/dist docs/dist
release-notes.md

9
npm/release-notes.js Normal file
View File

@ -0,0 +1,9 @@
const { readFileSync, writeFileSync } = require('node:fs');
const { version } = require('./package.json');
const versionWithoutPreRelease = version.replace(/-rc\.\d+$/, '');
const markdown = readFileSync(`./docs/src/content/docs/changelog/v${versionWithoutPreRelease}.md`, 'utf8');
const markdownWithoutFrontmatter = markdown.replace(/---\n.*?\n---\n+/s, '');
writeFileSync('./release-notes.md', markdownWithoutFrontmatter);

View File

@ -101,6 +101,7 @@
"test-leak": "./test/leak/leak.sh", "test-leak": "./test/leak/leak.sh",
"test-types": "tsd", "test-types": "tsd",
"package-from-local-build": "node npm/from-local-build.js", "package-from-local-build": "node npm/from-local-build.js",
"package-release-notes": "node npm/release-notes.js",
"docs-build": "node docs/build.mjs", "docs-build": "node docs/build.mjs",
"docs-serve": "cd docs && npm start", "docs-serve": "cd docs && npm start",
"docs-publish": "cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp" "docs-publish": "cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"