From 0b7868b8556a14013a19d4de275cf176fbd0a237 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 13 Jan 2024 20:45:36 -0500 Subject: [PATCH] chore: generated release notes --- .github/workflows/ci.yml | 32 +++++++--------------------- scripts/generate_release_notes.ts | 35 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 24 deletions(-) create mode 100644 scripts/generate_release_notes.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7472023..bb520fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,6 +83,10 @@ jobs: run: cargo publish # GITHUB RELEASE + - uses: denoland/setup-deno@v1 + if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') + with: + deno-version: v1.x - name: Pre-release if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') run: | @@ -90,8 +94,10 @@ jobs: sed -i 's/jupyter\/0.0.0/jupyter\/${{ steps.get_tag_version.outputs.TAG_VERSION }}/' deployment/schema.json # rename the wasm file (cd target/wasm32-unknown-unknown/release/ && mv dprint_plugin_jupyter.wasm plugin.wasm) + # create release notes + deno run -A ./scripts/generate_release_notes.ts ${{ steps.get_tag_version.outputs.TAG_VERSION }} > ${{ github.workspace }}-CHANGELOG.txt - name: Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -99,27 +105,5 @@ jobs: files: | target/wasm32-unknown-unknown/release/plugin.wasm deployment/schema.json - body: | - ## Install - - [Install](https://dprint.dev/install/) and [setup](https://dprint.dev/setup/) dprint. - - Then in your project's directory with a dprint.json file, run: - - ```shellsession - dprint config add jupyter - ``` - - Then add some additional formatting plugins to format the code blocks with. For example: - - ```shellsession - dprint config add typescript - dprint config add markdown - dprint config add ruff - ``` - - # ## JS Formatting API - - # * [JS Formatter](https://github.com/dprint/js-formatter) - Browser/Deno and Node - # * [npm package](https://www.npmjs.com/package/@dprint/jupyter) + body_path: ${{ github.workspace }}-CHANGELOG.txt draft: false diff --git a/scripts/generate_release_notes.ts b/scripts/generate_release_notes.ts new file mode 100644 index 0000000..1c97e58 --- /dev/null +++ b/scripts/generate_release_notes.ts @@ -0,0 +1,35 @@ +import { generateChangeLog } from "https://raw.githubusercontent.com/dprint/automation/0.9.0/changelog.ts"; + +const version = Deno.args[0]; +const changelog = await generateChangeLog({ + versionTo: version, +}); +const text = `## Changes + +${changelog} + +## Install + +[Install](https://dprint.dev/install/) and [setup](https://dprint.dev/setup/) dprint. + +Then in your project's directory with a dprint.json file, run: + +\`\`\`shellsession +dprint config add jupyter +\`\`\` + +Then add some additional formatting plugins to format the code blocks with. For example: + +\`\`\`shellsession +dprint config add typescript +dprint config add markdown +dprint config add ruff +\`\`\` +`; + +// ## JS Formatting API + +// * [JS Formatter](https://github.com/dprint/js-formatter) - Browser/Deno and Node +// * [npm package](https://www.npmjs.com/package/@dprint/jupyter) + +console.log(text);