Skip to content

Commit 7550168

Browse files
committed
Upload npm
1 parent ce2221b commit 7550168

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

.github/workflows/chdb-node-test.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,39 @@ name: chDB-node
22

33
on:
44
pull_request:
5+
branches: [ "main" ]
56
paths-ignore:
67
- '**/.md'
78
push:
89
branches: [ "main" ]
910
paths-ignore:
1011
- '**/.md'
1112

13+
1214
jobs:
1315
build:
14-
runs-on: ubuntu-latest
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macos-latest]
20+
node-version: [14.x, 16.x, 18.x]
1521
steps:
1622
- uses: actions/checkout@v3
17-
- name: Fetch library
18-
run: |
19-
wget https://github.com/chdb-io/chdb/releases/latest/download/linux-x86_64-libchdb.tar.gz
20-
tar -xzf linux-x86_64-libchdb.tar.gz
21-
sudo mv libchdb.so /usr/lib/libchdb.so
22-
sudo ldconfig
23-
- uses: actions/setup-node@v3
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v3
2425
with:
25-
node-version: 16
26-
- run: npm run libchdb
27-
- run: npm install
28-
- run: npm run build
29-
- run: npm test
26+
node-version: ${{ matrix.node-version }}
27+
registry-url: 'https://registry.npmjs.org'
28+
- name: Install dependencies
29+
run: npm install
30+
- name: Build libchdb
31+
run: npm run libchdb
32+
- name: Build project
33+
run: npm run build
34+
- name: Run tests
35+
run: npm run test
36+
- name: Publish to npm
37+
if: github.ref == 'refs/heads/main' && matrix.node-version == '14.x' && matrix.os == 'ubuntu-latest'
38+
run: npm publish
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)