Skip to content

Commit

Permalink
chore: add generated release notes (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Jan 14, 2024
1 parent 5637a11 commit 160b28c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 19 deletions.
22 changes: 3 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ jobs:
run: 'echo "::set-output name=CHECKSUM::$(shasum -a 256 plugin.json | awk ''{print $1}'')"'
- name: Update Config Schema Version
run: 'sed -i ''s/exec\/0.0.0/exec\/${{ steps.get_tag_version.outputs.TAG_VERSION }}/'' deployment/schema.json'
- name: Create release notes
run: deno run -A ./scripts/generate_release_notes.ts ${{ steps.get_tag_version.outputs.TAG_VERSION }} ${{ steps.get_plugin_file_checksum.outputs.CHECKSUM }} > ${{ github.workspace }}-CHANGELOG.txt
- name: Release
uses: softprops/action-gh-release@v1
env:
Expand All @@ -244,23 +246,5 @@ jobs:
dprint-plugin-exec-aarch64-unknown-linux-musl.zip
plugin.json
deployment/schema.json
body: |-
## Install
Dependencies:
- Install dprint's CLI >= 0.40.0
In a dprint configuration file:
1. Specify the plugin url and checksum in the `"plugins"` array or run `dprint config add exec`:
```jsonc
{
// etc...
"plugins": [
"https://plugins.dprint.dev/exec-${{ steps.get_tag_version.outputs.TAG_VERSION }}.json@${{ steps.get_plugin_file_checksum.outputs.CHECKSUM }}"
]
}
```
2. Follow the configuration setup instructions found at https://github.com/dprint/dprint-plugin-exec#configuration
body_path: ${{ github.workspace }}-CHANGELOG.txt
draft: false
32 changes: 32 additions & 0 deletions scripts/generate_release_notes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { generateChangeLog } from "https://raw.githubusercontent.com/dprint/automation/0.9.0/changelog.ts";

const version = Deno.args[0];
const checksum = Deno.args[1];
const changelog = await generateChangeLog({
versionTo: version,
});
const text = `## Changes
${changelog}
## Install
Dependencies:
- Install dprint's CLI >= 0.40.0
In a dprint configuration file:
1. Specify the plugin url and checksum in the \`"plugins"\` array or run \`dprint config add exec\`:
\`\`\`jsonc
{
// etc...
"plugins": [
"https://plugins.dprint.dev/exec-${version}.json@${checksum}"
]
}
\`\`\`
2. Follow the configuration setup instructions found at https://github.com/dprint/dprint-plugin-exec#configuration
`;

console.log(text);

0 comments on commit 160b28c

Please sign in to comment.