Skip to content

Commit dfbf692

Browse files
committed
add bun support
1 parent d01b50e commit dfbf692

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ env:
1616
# See https://github.com/nodejs/release#release-schedule
1717
# Node.js v20 EOL = 2026-04-30. v22 EOL = 2027-04-30. v23 EOL = 2025-06-01. v24 EOL = 2028-04-30.
1818
NODE_BUILD_CMD: npx --no-install prebuild -r node -t 20.0.0 -t 22.0.0 -t 23.0.0 -t 24.0.0 --include-regex '_sqlite3'
19+
# Bun versions - see https://github.com/oven-sh/bun/releases
20+
BUN_BUILD_CMD: npx --no-install prebuild -r bun -t 1.1.0 --include-regex '_sqlite3'
1921

2022
jobs:
2123
test:
@@ -53,6 +55,35 @@ jobs:
5355
- run: npm run build-debug
5456
- run: npm test
5557

58+
test-bun:
59+
strategy:
60+
matrix:
61+
os:
62+
- ubuntu-22.04
63+
- macos-13
64+
- macos-14
65+
bun:
66+
- 1.1.38
67+
name: Testing Bun ${{ matrix.bun }} on ${{ matrix.os }}
68+
runs-on: ${{ matrix.os }}
69+
steps:
70+
- uses: actions/checkout@v5
71+
- uses: oven-sh/setup-bun@v2
72+
with:
73+
bun-version: ${{ matrix.bun }}
74+
- if: ${{ startsWith(matrix.os, 'macos') }}
75+
run: brew install python-setuptools
76+
- if: ${{ !startsWith(matrix.os, 'macos') }}
77+
run: python3 -m pip install setuptools
78+
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
79+
run: |
80+
sudo apt update
81+
sudo apt install -y gcc-10 g++-10 libreadline-dev libncurses5-dev
82+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
83+
- run: bun install --ignore-scripts
84+
- run: bun run build-debug
85+
- run: bun test
86+
5687
publish:
5788
if: ${{ github.event_name == 'release' }}
5889
name: Publishing to NPM
@@ -63,6 +94,7 @@ jobs:
6394
- prebuild-alpine-arm
6495
- prebuild-linux-x64
6596
- prebuild-linux-arm
97+
- prebuild-bun
6698
steps:
6799
- uses: actions/checkout@v5
68100
- uses: actions/setup-node@v5
@@ -164,3 +196,35 @@ jobs:
164196
cd /tmp/project && \
165197
npm install --ignore-scripts && \
166198
${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}"
199+
200+
prebuild-bun:
201+
if: ${{ github.event_name == 'release' }}
202+
strategy:
203+
fail-fast: false
204+
matrix:
205+
os:
206+
- macos-13
207+
- macos-14
208+
- ubuntu-22.04
209+
name: Prebuild Bun on ${{ matrix.os }}
210+
runs-on: ${{ matrix.os }}
211+
needs: test-bun
212+
steps:
213+
- uses: actions/checkout@v5
214+
- uses: actions/setup-node@v5
215+
with:
216+
node-version: 20
217+
- uses: oven-sh/setup-bun@v2
218+
with:
219+
bun-version: 1.1.38
220+
- if: ${{ startsWith(matrix.os, 'macos') }}
221+
run: brew install python-setuptools
222+
- if: ${{ !startsWith(matrix.os, 'macos') }}
223+
run: python3 -m pip install setuptools
224+
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
225+
run: |
226+
sudo apt update
227+
sudo apt install -y gcc-10 g++-10 libreadline-dev libncurses5-dev
228+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
229+
- run: npm install --ignore-scripts
230+
- run: ${{ env.BUN_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)