Skip to content

Commit

Permalink
chore: generated release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jan 14, 2024
1 parent 23d8dfc commit 0b7868b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 24 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,43 +83,27 @@ 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: |
# update config schema to have version
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 }}
with:
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
35 changes: 35 additions & 0 deletions scripts/generate_release_notes.ts
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 0b7868b

Please sign in to comment.