support nodejs (#438)

This commit is contained in:
Fangjun Kuang
2023-11-21 23:20:08 +08:00
committed by GitHub
parent 38ad05bdf8
commit fe977b8e8e
34 changed files with 2704 additions and 4 deletions

58
.github/workflows/npm.yaml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: npm
on:
workflow_dispatch:
concurrency:
group: npm-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
nodejs:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8"]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-node@v3
with:
node-version: 13
registry-url: 'https://registry.npmjs.org'
- name: Display node version
shell: bash
run: |
node --version
npm --version
cd nodejs-examples
npm install npm@6.14.4 -g
npm install npm@6.14.4
npm --version
- name: Build nodejs package
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd scripts/nodejs
./run.sh
npm install
rm run.sh
npm ci
npm publish --provenance --access public