diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 46f3762..d8d3ea4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,13 +30,10 @@ 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 - # - name: Release - # run: npx semantic-release - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: release uses: actions/create-release@v1 id: create_release @@ -45,7 +42,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/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" 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);