Skip to content

Commit

Permalink
Merge pull request #14 from MarvNC:fix-release-workflow
Browse files Browse the repository at this point in the history
Fix Release Workflow?
  • Loading branch information
MarvNC authored Jul 12, 2024
2 parents 8d266a2 + bf46403 commit 4c4ce4b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
31 changes: 30 additions & 1 deletion .github/workflows/run-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
run-and-upload:
runs-on: ubuntu-latest
runs-on: windows-latest

steps:
- name: Checkout Repository
Expand All @@ -29,3 +29,32 @@ jobs:
uses: actions/upload-artifact@v4
with:
path: out/
release:
runs-on: windows-latest
needs: run-and-upload
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: package.json

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

- name: Generate Release Table
run: bun run releasetable ${{ github.ref }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: release.md
draft: true
prerelease: false
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"version": "1.5.0",
"scripts": {
"start": "bun run src/index.ts",
"startall": "bun run src/index.ts -a"
"startall": "bun run src/index.ts -a",
"releasetable": "bun run src/release.ts"
},
"dependencies": {
"inly": "^5.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { readdir } from 'node:fs/promises';

const EXPORT_FILE = './release.md';

const version = await getVersion();
let md = `# Download
const version = process.argv[2] ?? (await getVersion());
let md = `## Download
| Language | Download |
| --- | --- |
`;
Expand All @@ -22,7 +22,7 @@ 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(
} | [Download](https://github.com/MarvNC/wikipedia-yomitan/releases/download/${version}/${file.replace(
/ /g,
'.'
)}) |\n`;
Expand Down

0 comments on commit 4c4ce4b

Please sign in to comment.