Skip to content

Commit

Permalink
chore: add generated change log to releases (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Jan 8, 2024
1 parent 5f8ecfd commit 52d2c91
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 67 deletions.
37 changes: 8 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,48 +105,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/typescript\/0.0.0/typescript\/${{ steps.get_tag_version.outputs.TAG_VERSION }}/' deployment/schema.json
# rename the wasm file
(cd target/wasm32-unknown-unknown/release/ && mv dprint_plugin_typescript.wasm plugin.wasm)
# create release notes
deno run -A ./scripts/generateReleaseNotes.ts ${{ steps.get_tag_version.outputs.TAG_VERSION }} > ${{ github.workspace }}-CHANGELOG.txt
- name: Release
uses: softprops/action-gh-release@59c3b4891632ff9a897f99a91d7bc557467a3a22
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 dprint configuration file:
1. Specify the plugin url in the `"plugins"` array.
2. Add a `"typescript"` configuration property if desired.
```jsonc
{
// ...etc...
"typescript": {
// TypeScript & JavaScript config goes here
},
"excludes": [
"**/node_modules"
],
"plugins": [
"https://plugins.dprint.dev/typescript-${{ steps.get_tag_version.outputs.TAG_VERSION }}.wasm"
]
}
```
## JS Formatting API
* [JS Formatter](https://github.com/dprint/js-formatter) - Browser/Deno and Node
* [npm package](https://www.npmjs.com/package/@dprint/typescript)
body_path: ${{ github.workspace }}-CHANGELOG.txt
draft: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
sourcemap
deployment/npm/plugin.wasm
deployment/npm/node_modules
.vscode
27 changes: 0 additions & 27 deletions .vscode/launch.json

This file was deleted.

11 changes: 0 additions & 11 deletions .vscode/tasks.json

This file was deleted.

37 changes: 37 additions & 0 deletions scripts/generateReleaseNotes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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 = `${changelog}\n
## Install
[Install](https://dprint.dev/install/) and [setup](https://dprint.dev/setup/) dprint.
Then in your project's dprint configuration file:
1. Specify the plugin url in the \`"plugins"\` array.
2. Add a \`"typescript"\` configuration property if desired.
\`\`\`jsonc
{
// ...etc...
"typescript": {
// TypeScript & JavaScript config goes here
},
"excludes": [
"**/node_modules"
],
"plugins": [
"https://plugins.dprint.dev/typescript-${version}.wasm"
]
}
\`\`\`
## JS Formatting API
* [JS Formatter](https://github.com/dprint/js-formatter) - Browser/Deno and Node
* [npm package](https://www.npmjs.com/package/@dprint/typescript)
`;

console.log(text);

0 comments on commit 52d2c91

Please sign in to comment.