Skip to content

Commit 0f7b37a

Browse files
committed
ci: 👷 Use Bun version with writeStream /fd/ fix
oven-sh/bun#4378 fixed issue causing CI to fail when running changeset
1 parent 8ddb0da commit 0f7b37a

File tree

8 files changed

+19
-33
lines changed

8 files changed

+19
-33
lines changed

.github/workflows/pr.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
workflow_dispatch:
88

9+
concurrency: ${{ github.workflow }}-${{ github.ref }}
10+
911
jobs:
1012
test:
1113
name: "Pull Request Linting"
@@ -20,6 +22,7 @@ jobs:
2022
- name: "Install Dependencies"
2123
run: bun install
2224
- name: "Run Linter"
23-
run: bun run lint
24-
- name: "Format Code"
25-
run: bun run format
25+
run: bun run test
26+
- name: "Test"
27+
# remove after Bun test done
28+
run: bun run test-script

.github/workflows/publish.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,14 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v3
15-
- uses: oven-sh/setup-bun@v1
16-
- uses: actions/setup-node@v3
17-
with:
18-
node-version: '*'
19-
- name: Install Dependencies
20-
run: bun install
21-
- name: Lint
22-
run: bun lint
23-
- name: Build
24-
run: bun run build
25-
2615
- name: Package
2716
run: |
2817
zip -r forbidden-lands.zip assets fonts lang templates forbidden-lands.js forbidden-lands.css system.json template.json CHANGELOG.md CONTRIBUTING.md LICENSE README.md
29-
- name: 🚀 Update Release with Artifacts
18+
- name: Update Release with Artifacts
3019
uses: ncipollo/[email protected]
3120
with:
3221
allowUpdates: true
3322
name: ${{ github.event.release.name }}
34-
draft: false
35-
prerelease: false
3623
tag: ${{ github.event.release.tag_name }}
3724
body: ${{ github.event.release.body }}
3825
artifacts: './forbidden-lands.zip'

.github/workflows/release.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,13 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v3
1616
- uses: oven-sh/setup-bun@v1
17-
- uses: actions/setup-node@v3
1817
with:
19-
node-version: '*'
18+
bun-version: canary
2019
- name: Install Dependencies
2120
run: bun install
22-
- name: Lint
23-
run: bun lint
2421
- name: Build
2522
run: bun run build
26-
- name: Create Release Pull Request
23+
- name: Create Release or Version
2724
uses: changesets/action@v1
2825
with:
2926
commit: 'chore(release): Version Package'

bun.lockb

174 Bytes
Binary file not shown.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424
"format": "rome format --write .",
2525
"lint": "bun run test && rome check --apply .",
2626
"postinstall": "lefthook install && bun run setup",
27-
"release": "node tools/release.js",
27+
"release": "bun tools/release.js",
2828
"setup": "bun tools/setup.ts",
2929
"start": "bun run build --development",
3030
"test": "bun run test:types && bunx rome ci .",
3131
"test:types": "bunx tsc && bunx tsc -p ./src/tsconfig.json",
32-
"version": "node tools/version.js"
32+
"version": "bun tools/version.js",
33+
"test-script": "bunx changeset version && bunx changeset tag"
3334
},
3435
"dependencies": {
3536
"rpg-awesome": "0.2.0",
@@ -43,7 +44,7 @@
4344
"@types/jquery": "3.5.17",
4445
"@types/node": "^20.5.7",
4546
"@types/showdown": "2.0.1",
46-
"bun": "0.8.1",
47+
"bun": "canary",
4748
"devmoji": "2.3.0",
4849
"esbuild": "0.19.2",
4950
"esbuild-sass-plugin": "2.13.0",

tools/release.js renamed to tools/release.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Use Bun when Bun supports node:fs/promises fully
2-
31
import { $, execa } from "execa";
42

53
import rootConfig from "../package.json" assert { type: "json" };
@@ -29,8 +27,8 @@ if (exitCode !== 2) {
2927

3028
await $`git checkout --detach`;
3129
await $`git add --force forbidden-lands.js forbidden-lands.css`;
32-
await execa("git", ["commit", "-m", "chore(release): :rocket: ${tag}"]);
30+
await execa("git", ["commit", "-m", `chore(release): ${tag}`]);
3331

34-
await $`npx changeset tag`;
32+
await $`bunx changeset tag`;
3533

3634
await $`git push --force --follow-tags origin HEAD:refs/heads/${releaseLine}`;

tools/version.js renamed to tools/version.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import { writeFile } from "node:fs/promises";
66
/**
77
* Convenience function to handle an stderr from execa.
88
*/
9-
function handlePossibleError({ stderr }) {
9+
function handlePossibleError({ stderr }: { stderr: string }) {
1010
if (!stderr) return;
1111
console.error(stderr);
1212
process.exit(1);
1313
}
1414

1515
// Version package
16-
await $`npx changeset version`.then(handlePossibleError);
16+
await $`bunx changeset version`.then(handlePossibleError);
1717

1818
// Import versioned package.json
1919
const {
@@ -33,4 +33,4 @@ manifest.download = manifest.download.replace(/v\d+\.\d+\.\d+/, `v${version}`);
3333
await writeFile("system.json", JSON.stringify(manifest, null, "\t") + "\n");
3434

3535
// Format system.json
36-
await $`npx rome format --write system.json`.then(handlePossibleError);
36+
await $`bunx rome format --write system.json`.then(handlePossibleError);

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"lib": ["ESNext"],
1111
"types": []
1212
},
13-
"include": ["./**/*.ts", "tools/version.js", "tools/release.js"],
13+
"include": ["./**/*.ts"],
1414
"exclude": ["node_modules", "src"]
1515
}

0 commit comments

Comments
 (0)