Skip to content

Commit

Permalink
Merge pull request #13 from MarvNC:add-release
Browse files Browse the repository at this point in the history
Add Release Script
  • Loading branch information
MarvNC authored Jul 12, 2024
2 parents fe0a636 + 278d708 commit d110de0
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/run-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json
- run: sudo apt-get install -y bzip2
- run: bun install --frozen-lockfile
- run: bun run start -a
- name: Upload artifacts

- name: Install bzip2
run: sudo apt-get install -y bzip2

- name: Install Dependencies
run: bun install --frozen-lockfile

- name: Run Application
run: bun run start -a

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
path: out/
32 changes: 32 additions & 0 deletions src/release.ts
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);

0 comments on commit d110de0

Please sign in to comment.