mirror of
https://github.com/lovell/sharp.git
synced 2025-08-23 21:21:40 +02:00
CI: Remove frontmatter from release notes
This commit is contained in:
parent
9e20a25c5d
commit
dda00f63e6
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@ -313,12 +313,13 @@ jobs:
|
||||
path: npm
|
||||
- name: Create npm workspace tarball
|
||||
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')
|
||||
uses: madhead/semver-utils@v4
|
||||
id: semver
|
||||
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
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: ncipollo/release-action@v1
|
||||
@ -327,4 +328,4 @@ jobs:
|
||||
artifactContentType: application/x-xz
|
||||
prerelease: ${{ 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
1
.gitignore
vendored
@ -16,3 +16,4 @@ package-lock.json
|
||||
.firebase
|
||||
.astro
|
||||
docs/dist
|
||||
release-notes.md
|
||||
|
9
npm/release-notes.js
Normal file
9
npm/release-notes.js
Normal 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);
|
@ -101,6 +101,7 @@
|
||||
"test-leak": "./test/leak/leak.sh",
|
||||
"test-types": "tsd",
|
||||
"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-serve": "cd docs && npm start",
|
||||
"docs-publish": "cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user