Skip to content

Commit

Permalink
Merge pull request #6 from chdb-io/uploadNpm
Browse files Browse the repository at this point in the history
Upload npm
  • Loading branch information
auxten committed Jan 3, 2024
2 parents 782a8c1 + b76b911 commit 5e38abe
Show file tree
Hide file tree
Showing 8 changed files with 684 additions and 2,750 deletions.
37 changes: 24 additions & 13 deletions .github/workflows/chdb-node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,39 @@ name: chDB-node

on:
pull_request:
branches: [ "main" ]
paths-ignore:
- '**/.md'
push:
branches: [ "main" ]
paths-ignore:
- '**/.md'


jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node-version: [16.x, 18.x]
steps:
- name: Use Python 3.11
uses: actions/setup-python@v2
with:
python-version: '3.11'
- uses: actions/checkout@v3
- name: Fetch library
run: |
wget https://github.com/chdb-io/chdb/releases/latest/download/linux-x86_64-libchdb.tar.gz
tar -xzf linux-x86_64-libchdb.tar.gz
sudo mv libchdb.so /usr/lib/libchdb.so
sudo ldconfig
- uses: actions/setup-node@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 16
- run: npm run libchdb
- run: npm install
- run: npm run build
- run: npm test
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
- name: Publish to npm
if: github.ref == 'refs/heads/main' && matrix.node-version == '16.x' && matrix.os == 'ubuntu-latest'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build
/user_defined
.vscode/
libchdb.so
chdb.h
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
```bash
npm run libchdb
npm install
npm build
npm run test
```

Expand Down
8 changes: 4 additions & 4 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"sources": [ "lib/chdb_node.cpp" ],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")",
"lib/"
"."
],
"libraries": [ "-L<(module_root_dir)/lib", "-lchdb" ],
# "cflags!": [ "-fno-exceptions" ],
# "cflags_cc!": [ "-fno-exceptions" ],
"libraries": [ "<(module_root_dir)/libchdb.so" ],
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ]
}
]
Expand Down
28 changes: 0 additions & 28 deletions lib/chdb.h

This file was deleted.

Loading

0 comments on commit 5e38abe

Please sign in to comment.