Skip to content

Commit 5e38abe

Browse files
authored
Merge pull request #6 from chdb-io/uploadNpm
Upload npm
2 parents 782a8c1 + b76b911 commit 5e38abe

File tree

8 files changed

+684
-2750
lines changed

8 files changed

+684
-2750
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: [16.x, 18.x]
1521
steps:
22+
- name: Use Python 3.11
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: '3.11'
1626
- 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
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v3
2429
with:
25-
node-version: 16
26-
- run: npm run libchdb
27-
- run: npm install
28-
- run: npm run build
29-
- run: npm test
30+
node-version: ${{ matrix.node-version }}
31+
registry-url: 'https://registry.npmjs.org'
32+
- name: Install dependencies
33+
run: npm install
34+
- name: Run tests
35+
run: npm run test
36+
- name: Publish to npm
37+
if: github.ref == 'refs/heads/main' && matrix.node-version == '16.x' && matrix.os == 'ubuntu-latest'
38+
run: npm publish
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ build
44
/user_defined
55
.vscode/
66
libchdb.so
7+
chdb.h

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
```bash
1616
npm run libchdb
1717
npm install
18-
npm build
1918
npm run test
2019
```
2120

binding.gyp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"sources": [ "lib/chdb_node.cpp" ],
99
"include_dirs": [
1010
"<!@(node -p \"require('node-addon-api').include\")",
11-
"lib/"
11+
"."
1212
],
13-
"libraries": [ "-L<(module_root_dir)/lib", "-lchdb" ],
14-
# "cflags!": [ "-fno-exceptions" ],
15-
# "cflags_cc!": [ "-fno-exceptions" ],
13+
"libraries": [ "<(module_root_dir)/libchdb.so" ],
14+
"cflags!": [ "-fno-exceptions" ],
15+
"cflags_cc!": [ "-fno-exceptions" ],
1616
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ]
1717
}
1818
]

lib/chdb.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)