mirror of
https://github.com/k2-fsa/sherpa-onnx.git
synced 2026-11-10 21:11:03 +08:00
Fixes #3731 espeak-ng and piper-phonemize are no longer built into sherpa-onnx. Text frontends are now: - **lexicon** — built in, no extra dependency - **phonemize** — phonemize outside sherpa-onnx (e.g. [piper-phonemize](https://github.com/csukuangfj/piper-phonemize)) and pass the result in. That library is GPL, so it stays optional: sherpa-onnx is GPL-free after this PR. ## API - `SherpaOnnxGenerationConfig` gains `phoneme_codepoints` and `tokens` (mutually exclusive alternatives to `text`) - `data_dir` on the TTS model configs is deprecated and ignored; the ABI slot is kept - all bindings updated: C/C++, Python, Java, Kotlin, Go, Rust, C#, Swift, Pascal, Dart/Flutter, node-addon, WASM, HarmonyOS
85 lines
2.4 KiB
YAML
85 lines
2.4 KiB
YAML
name: test-node-addon-npm
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- '.github/workflows/test-nodejs-addon-npm.yaml'
|
|
- '.github/scripts/test-nodejs-addon-npm.sh'
|
|
- 'cmake/**'
|
|
- 'sherpa-onnx/csrc/*'
|
|
- 'sherpa-onnx/c-api/*'
|
|
- 'scripts/node-addon-api/**'
|
|
- 'scripts/node-addon-api/*.js'
|
|
- 'nodejs-addon-examples/**'
|
|
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: test-node-addon-npm-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test-node-addon-npm:
|
|
name: ${{ matrix.os }} node v${{ matrix.node-version }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [macos-latest, macos-14, ubuntu-latest, ubuntu-22.04, windows-2022]
|
|
node-version: ["16", "17", "18", "19", "21", "22"]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Update version
|
|
shell: bash
|
|
run: |
|
|
./new-release.sh
|
|
git diff .
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
registry-url: 'https://registry.npmjs.org'
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Display node version
|
|
shell: bash
|
|
run: |
|
|
node --version
|
|
|
|
- name: Run tests
|
|
shell: bash
|
|
run: |
|
|
d=nodejs-addon-examples
|
|
echo "dir: $d"
|
|
cd $d
|
|
npm install --verbose
|
|
git status
|
|
ls -lh
|
|
ls -lh node_modules
|
|
|
|
export DYLD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-darwin-x64:$DYLD_LIBRARY_PATH
|
|
export DYLD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-darwin-arm64:$DYLD_LIBRARY_PATH
|
|
export LD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-darwin-x64:$DYLD_LIBRARY_PATH
|
|
export LD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-darwin-arm64:$DYLD_LIBRARY_PATH
|
|
export LD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-linux-x64:$LD_LIBRARY_PATH
|
|
export LD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-linux-arm64:$LD_LIBRARY_PATH
|
|
|
|
cd ../
|
|
|
|
.github/scripts/test-nodejs-addon-npm.sh
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: tts-waves-${{ matrix.os }}-${{ matrix.node-version }}
|
|
path: |
|
|
nodejs-addon-examples/test-*-lexicon.wav
|
|
nodejs-addon-examples/test-*-phonemize.wav
|
|
if-no-files-found: warn
|