Skip to content

Commit f8b4b1b

Browse files
committed
ci: dynamically set bun version from package.json
Read bun version from package.json engines field instead of hardcoding it in workflows
1 parent 7005c94 commit f8b4b1b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/build-binaries.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ jobs:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
2828

29+
- name: Read Bun version from package.json
30+
id: bun-version
31+
shell: bash
32+
run: echo "version=$(jq -r '.engines.bun' package.json)" >> $GITHUB_OUTPUT
33+
2934
- name: Setup Bun
3035
uses: oven-sh/setup-bun@v1
3136
with:
32-
bun-version: 1.3.0
37+
bun-version: ${{ steps.bun-version.outputs.version }}
3338

3439
- name: Install dependencies
3540
run: bun install --frozen-lockfile

.github/workflows/publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ jobs:
3030
with:
3131
fetch-depth: 0
3232

33+
- name: Read Bun version from package.json
34+
id: bun-version
35+
run: echo "version=$(jq -r '.engines.bun' package.json)" >> $GITHUB_OUTPUT
36+
3337
- name: Setup Bun
3438
uses: oven-sh/setup-bun@v1
3539
with:
36-
bun-version: 1.3.0
40+
bun-version: ${{ steps.bun-version.outputs.version }}
3741

3842
- name: Install dependencies
3943
run: bun install --frozen-lockfile

0 commit comments

Comments
 (0)