-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from MarvNC:add-release
Add Release Script
- Loading branch information
Showing
2 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* This file is used to generate the release notes for the GitHub release. | ||
* It makes a table of all the languages and a download link for each. | ||
*/ | ||
|
||
import { write } from 'bun'; | ||
import { LANGUAGE_CODES, languageUtils } from './constants'; | ||
import { getVersion } from './util/getVersion'; | ||
// read directory | ||
import { readdir } from 'node:fs/promises'; | ||
|
||
const EXPORT_FILE = './release.md'; | ||
|
||
const version = await getVersion(); | ||
let md = `# Download | ||
| Language | Download | | ||
| --- | --- | | ||
`; | ||
|
||
const files = await readdir('./out'); | ||
for (const file of files) { | ||
const lang = languageUtils[file.substring(0, 2).toLowerCase()]; | ||
md += `| ${ | ||
lang.fullName | ||
} | [Download](https://github.com/MarvNC/wikipedia-yomitan/releases/latest/download/${file.replace( | ||
/ /g, | ||
'.' | ||
)}) |\n`; | ||
} | ||
|
||
// Export | ||
await write(EXPORT_FILE, md); |