Upload npm #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: chDB-node | |
on: | |
pull_request: | |
branches: [ "main" ] | |
paths-ignore: | |
- '**/.md' | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- '**/.md' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
node-version: [14.x, 16.x, 18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://registry.npmjs.org' | |
- name: Use Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: npm install | |
- name: Build libchdb | |
run: npm run libchdb | |
- name: Build project | |
run: npm run build | |
- name: Run tests | |
run: npm run test | |
- name: Publish to npm | |
if: github.ref == 'refs/heads/main' && matrix.node-version == '14.x' && matrix.os == 'ubuntu-latest' | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |