Skip to content

Commit 160b28c

Browse files
authored
chore: add generated release notes (#33)
1 parent 5637a11 commit 160b28c

File tree

2 files changed

+35
-19
lines changed

2 files changed

+35
-19
lines changed

Diff for: .github/workflows/ci.yml

+3-19
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ jobs:
229229
run: 'echo "::set-output name=CHECKSUM::$(shasum -a 256 plugin.json | awk ''{print $1}'')"'
230230
- name: Update Config Schema Version
231231
run: 'sed -i ''s/exec\/0.0.0/exec\/${{ steps.get_tag_version.outputs.TAG_VERSION }}/'' deployment/schema.json'
232+
- name: Create release notes
233+
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
232234
- name: Release
233235
uses: softprops/action-gh-release@v1
234236
env:
@@ -244,23 +246,5 @@ jobs:
244246
dprint-plugin-exec-aarch64-unknown-linux-musl.zip
245247
plugin.json
246248
deployment/schema.json
247-
body: |-
248-
## Install
249-
250-
Dependencies:
251-
252-
- Install dprint's CLI >= 0.40.0
253-
254-
In a dprint configuration file:
255-
256-
1. Specify the plugin url and checksum in the `"plugins"` array or run `dprint config add exec`:
257-
```jsonc
258-
{
259-
// etc...
260-
"plugins": [
261-
"https://plugins.dprint.dev/exec-${{ steps.get_tag_version.outputs.TAG_VERSION }}.json@${{ steps.get_plugin_file_checksum.outputs.CHECKSUM }}"
262-
]
263-
}
264-
```
265-
2. Follow the configuration setup instructions found at https://github.com/dprint/dprint-plugin-exec#configuration
249+
body_path: ${{ github.workspace }}-CHANGELOG.txt
266250
draft: false

Diff for: scripts/generate_release_notes.ts

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { generateChangeLog } from "https://raw.githubusercontent.com/dprint/automation/0.9.0/changelog.ts";
2+
3+
const version = Deno.args[0];
4+
const checksum = Deno.args[1];
5+
const changelog = await generateChangeLog({
6+
versionTo: version,
7+
});
8+
const text = `## Changes
9+
10+
${changelog}
11+
12+
## Install
13+
14+
Dependencies:
15+
16+
- Install dprint's CLI >= 0.40.0
17+
18+
In a dprint configuration file:
19+
20+
1. Specify the plugin url and checksum in the \`"plugins"\` array or run \`dprint config add exec\`:
21+
\`\`\`jsonc
22+
{
23+
// etc...
24+
"plugins": [
25+
"https://plugins.dprint.dev/exec-${version}.json@${checksum}"
26+
]
27+
}
28+
\`\`\`
29+
2. Follow the configuration setup instructions found at https://github.com/dprint/dprint-plugin-exec#configuration
30+
`;
31+
32+
console.log(text);

0 commit comments

Comments
 (0)