From 6510251b998325c52667468091e60a4d352782ee Mon Sep 17 00:00:00 2001 From: Frederic Brodbeck Date: Tue, 28 Mar 2023 00:31:50 +0200 Subject: [PATCH 1/3] script to generate release note --- .github/workflows/main.yml | 3 ++- .gitignore | 1 + changelog.md | 7 +++++++ scripts/make-release-note.js | 23 +++++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 changelog.md create mode 100644 scripts/make-release-note.js diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 46f3762..1df44f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,6 +30,7 @@ jobs: node-version: "18" - run: npm install - run: npm run build + - run: node scripts/make-release-note.js - name: Install zip uses: montudor/action-zip@v1 - run: zip -r dist.zip ./dist package.json @@ -45,7 +46,7 @@ jobs: prerelease: false release_name: ${{ steps.version.outputs.version }} tag_name: ${{ github.ref }} - # body_path: CHANGELOG.md + body_path: release-note.md env: GITHUB_TOKEN: ${{ github.token }} - name: upload artifact diff --git a/.gitignore b/.gitignore index f0d4ec6..17237a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules dist _screen-capture +release-note.md diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..ae03283 --- /dev/null +++ b/changelog.md @@ -0,0 +1,7 @@ +# Changelog + + +## 1.2.2 + +### Added +- Changelog / release notes diff --git a/scripts/make-release-note.js b/scripts/make-release-note.js new file mode 100644 index 0000000..a12e24a --- /dev/null +++ b/scripts/make-release-note.js @@ -0,0 +1,23 @@ +const fs = require('fs'); +const R = require('ramda'); + + +const content = fs.readFileSync('./changelog.md').toString(); +let lines = content.split('\n'); + +let numTagsSeen = 0; +lines = R.takeWhile( + (line) => { + if (line.startsWith('## ')) { + numTagsSeen += 1; + } + if (numTagsSeen >= 2) { + return false; + } + return true; + }, + lines +); + +const releaseNotes = lines.join('\n').trim(); +fs.writeFileSync('release-note.md', releaseNotes); From 9d5526882210d16da7a3e568a6f785c6a34eed2a Mon Sep 17 00:00:00 2001 From: Frederic Brodbeck Date: Tue, 28 Mar 2023 00:31:56 +0200 Subject: [PATCH 2/3] clean up --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1df44f6..d8d3ea4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,10 +34,6 @@ jobs: - name: Install zip uses: montudor/action-zip@v1 - run: zip -r dist.zip ./dist package.json - # - name: Release - # run: npx semantic-release - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: release uses: actions/create-release@v1 id: create_release From 700eb6a89a7911906bc762a59cd37d0ba4f7cf46 Mon Sep 17 00:00:00 2001 From: Frederic Brodbeck Date: Tue, 28 Mar 2023 00:32:29 +0200 Subject: [PATCH 3/3] version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d76271..9e7daba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "logseq-plugin-jump-to-block", - "version": "1.2.1", + "version": "1.2.2", "main": "dist/index.html", "logseq": { "id": "logseq-plugin-jump-to-block"