Publish npm package with node-addon-api for Windows (#838)
This commit is contained in:
1
.github/scripts/node-addon/notes.md
vendored
1
.github/scripts/node-addon/notes.md
vendored
@@ -6,3 +6,4 @@ See also
|
||||
- https://stackoverflow.com/questions/15176082/npm-package-json-os-specific-dependency
|
||||
- https://github.com/WonderInventions/node-webrtc/blob/develop/lib/binding.js
|
||||
- cross-compiling https://github.com/nodejs/node-gyp/issues/829#issuecomment-665527032
|
||||
- https://nodejs.github.io/node-addon-examples/build-tools/cmake-js
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "sherpa-onnx-PLATFORM-ARCH",
|
||||
"name": "sherpa-onnx-PLATFORM2-ARCH",
|
||||
"version": "SHERPA_ONNX_VERSION",
|
||||
"description": "Speech-to-text and text-to-speech using Next-gen Kaldi without internet connection",
|
||||
"main": "index.js",
|
||||
|
||||
3
.github/scripts/node-addon/package.json
vendored
3
.github/scripts/node-addon/package.json
vendored
@@ -47,6 +47,7 @@
|
||||
"optionalDependencies": {
|
||||
"sherpa-onnx-darwin-arm64": "^SHERPA_ONNX_VERSION",
|
||||
"sherpa-onnx-darwin-x64": "^SHERPA_ONNX_VERSION",
|
||||
"sherpa-onnx-linux-x64": "^SHERPA_ONNX_VERSION"
|
||||
"sherpa-onnx-linux-x64": "^SHERPA_ONNX_VERSION",
|
||||
"sherpa-onnx-win-x64": "^SHERPA_ONNX_VERSION"
|
||||
}
|
||||
}
|
||||
|
||||
6
.github/scripts/node-addon/run.sh
vendored
6
.github/scripts/node-addon/run.sh
vendored
@@ -7,6 +7,11 @@ src_dir=$sherpa_onnx_dir/.github/scripts/node-addon
|
||||
|
||||
platform=$(node -p "require('os').platform()")
|
||||
arch=$(node -p "require('os').arch()")
|
||||
platform2=$platform
|
||||
|
||||
if [[ $platform == win32 ]]; then
|
||||
platform2=win
|
||||
fi
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
@@ -17,6 +22,7 @@ fi
|
||||
|
||||
sed -i.bak s/SHERPA_ONNX_VERSION/$SHERPA_ONNX_VERSION/g $src_dir/package-optional.json
|
||||
sed -i.bak s/k2-fsa/$owner/g $src_dir/package-optional.json
|
||||
sed -i.bak s/PLATFORM2/$platform2/g $src_dir/package-optional.json
|
||||
sed -i.bak s/PLATFORM/$platform/g $src_dir/package-optional.json
|
||||
sed -i.bak s/ARCH/$arch/g $src_dir/package-optional.json
|
||||
|
||||
|
||||
Reference in New Issue
Block a user