Skip to content

Commit 52d2c91

Browse files
authored
chore: add generated change log to releases (#598)
1 parent 5f8ecfd commit 52d2c91

File tree

5 files changed

+46
-67
lines changed

5 files changed

+46
-67
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -105,48 +105,27 @@ jobs:
105105
run: cargo publish
106106

107107
# GITHUB RELEASE
108+
- uses: denoland/setup-deno@v1
109+
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
110+
with:
111+
deno-version: v1.x
108112
- name: Pre-release
109113
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
110114
run: |
111115
# update config schema to have version
112116
sed -i 's/typescript\/0.0.0/typescript\/${{ steps.get_tag_version.outputs.TAG_VERSION }}/' deployment/schema.json
113117
# rename the wasm file
114118
(cd target/wasm32-unknown-unknown/release/ && mv dprint_plugin_typescript.wasm plugin.wasm)
119+
# create release notes
120+
deno run -A ./scripts/generateReleaseNotes.ts ${{ steps.get_tag_version.outputs.TAG_VERSION }} > ${{ github.workspace }}-CHANGELOG.txt
115121
- name: Release
116-
uses: softprops/action-gh-release@59c3b4891632ff9a897f99a91d7bc557467a3a22
122+
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
117123
if: matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
118124
env:
119125
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120126
with:
121127
files: |
122128
target/wasm32-unknown-unknown/release/plugin.wasm
123129
deployment/schema.json
124-
body: |
125-
## Install
126-
127-
[Install](https://dprint.dev/install/) and [setup](https://dprint.dev/setup/) dprint.
128-
129-
Then in your project's dprint configuration file:
130-
131-
1. Specify the plugin url in the `"plugins"` array.
132-
2. Add a `"typescript"` configuration property if desired.
133-
```jsonc
134-
{
135-
// ...etc...
136-
"typescript": {
137-
// TypeScript & JavaScript config goes here
138-
},
139-
"excludes": [
140-
"**/node_modules"
141-
],
142-
"plugins": [
143-
"https://plugins.dprint.dev/typescript-${{ steps.get_tag_version.outputs.TAG_VERSION }}.wasm"
144-
]
145-
}
146-
```
147-
148-
## JS Formatting API
149-
150-
* [JS Formatter](https://github.com/dprint/js-formatter) - Browser/Deno and Node
151-
* [npm package](https://www.npmjs.com/package/@dprint/typescript)
130+
body_path: ${{ github.workspace }}-CHANGELOG.txt
152131
draft: false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
sourcemap
44
deployment/npm/plugin.wasm
55
deployment/npm/node_modules
6+
.vscode

.vscode/launch.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

.vscode/tasks.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

scripts/generateReleaseNotes.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { generateChangeLog } from "https://raw.githubusercontent.com/dprint/automation/0.9.0/changelog.ts";
2+
3+
const version = Deno.args[0];
4+
const changelog = await generateChangeLog({
5+
versionTo: version,
6+
});
7+
const text = `${changelog}\n
8+
## Install
9+
10+
[Install](https://dprint.dev/install/) and [setup](https://dprint.dev/setup/) dprint.
11+
12+
Then in your project's dprint configuration file:
13+
14+
1. Specify the plugin url in the \`"plugins"\` array.
15+
2. Add a \`"typescript"\` configuration property if desired.
16+
\`\`\`jsonc
17+
{
18+
// ...etc...
19+
"typescript": {
20+
// TypeScript & JavaScript config goes here
21+
},
22+
"excludes": [
23+
"**/node_modules"
24+
],
25+
"plugins": [
26+
"https://plugins.dprint.dev/typescript-${version}.wasm"
27+
]
28+
}
29+
\`\`\`
30+
31+
## JS Formatting API
32+
33+
* [JS Formatter](https://github.com/dprint/js-formatter) - Browser/Deno and Node
34+
* [npm package](https://www.npmjs.com/package/@dprint/typescript)
35+
`;
36+
37+
console.log(text);

0 commit comments

Comments
 (0)