diff --git a/.github/scripts/test-dot-net.sh b/.github/scripts/test-dot-net.sh index 6c3305dd..adc85852 100755 --- a/.github/scripts/test-dot-net.sh +++ b/.github/scripts/test-dot-net.sh @@ -2,7 +2,11 @@ cd dotnet-examples/ -cd ./speech-enhancement-gtcrn +cd ./version-test +./run.sh +ls -lh + +cd ../speech-enhancement-gtcrn ./run.sh ls -lh diff --git a/.github/scripts/test-swift.sh b/.github/scripts/test-swift.sh index 14b527be..b7c13c73 100755 --- a/.github/scripts/test-swift.sh +++ b/.github/scripts/test-swift.sh @@ -7,6 +7,8 @@ echo "pwd: $PWD" cd swift-api-examples ls -lh +./run-test-version.sh + ./run-decode-file-sense-voice-with-hr.sh rm -rf sherpa-onnx-sense-voice-* rm -rf dict lexicon.txt replace.fst test-hr.wav diff --git a/.github/workflows/aarch64-linux-gnu-shared.yaml b/.github/workflows/aarch64-linux-gnu-shared.yaml index 159138c3..c9d33535 100644 --- a/.github/workflows/aarch64-linux-gnu-shared.yaml +++ b/.github/workflows/aarch64-linux-gnu-shared.yaml @@ -58,6 +58,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Build sherpa-onnx if: matrix.gpu == 'ON' shell: bash diff --git a/.github/workflows/aarch64-linux-gnu-static.yaml b/.github/workflows/aarch64-linux-gnu-static.yaml index a8da8ce7..3526912d 100644 --- a/.github/workflows/aarch64-linux-gnu-static.yaml +++ b/.github/workflows/aarch64-linux-gnu-static.yaml @@ -43,6 +43,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Build sherpa-onnx uses: addnab/docker-run-action@v3 with: diff --git a/.github/workflows/android-rknn.yaml b/.github/workflows/android-rknn.yaml index eaf10666..6af64a03 100644 --- a/.github/workflows/android-rknn.yaml +++ b/.github/workflows/android-rknn.yaml @@ -47,6 +47,12 @@ jobs: with: key: ${{ matrix.os }}-android-rknn + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Display NDK HOME shell: bash run: | @@ -158,6 +164,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/android-static.yaml b/.github/workflows/android-static.yaml index 35505c91..e21fdc36 100644 --- a/.github/workflows/android-static.yaml +++ b/.github/workflows/android-static.yaml @@ -45,6 +45,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -190,6 +196,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index eb01120f..bae70b38 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -42,6 +42,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -184,6 +190,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-asr-2pass.yaml b/.github/workflows/apk-asr-2pass.yaml index 7cb4253f..e7c8f627 100644 --- a/.github/workflows/apk-asr-2pass.yaml +++ b/.github/workflows/apk-asr-2pass.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-asr.yaml b/.github/workflows/apk-asr.yaml index e49b179c..b6fd9630 100644 --- a/.github/workflows/apk-asr.yaml +++ b/.github/workflows/apk-asr.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-audio-tagging-wearos.yaml b/.github/workflows/apk-audio-tagging-wearos.yaml index bfe9f9ac..7bd01c11 100644 --- a/.github/workflows/apk-audio-tagging-wearos.yaml +++ b/.github/workflows/apk-audio-tagging-wearos.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-audio-tagging.yaml b/.github/workflows/apk-audio-tagging.yaml index bd8cd7e0..d7292982 100644 --- a/.github/workflows/apk-audio-tagging.yaml +++ b/.github/workflows/apk-audio-tagging.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-kws.yaml b/.github/workflows/apk-kws.yaml index 43cdef49..951d05e5 100644 --- a/.github/workflows/apk-kws.yaml +++ b/.github/workflows/apk-kws.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-speaker-diarization.yaml b/.github/workflows/apk-speaker-diarization.yaml index 90bcc732..9ba71b9f 100644 --- a/.github/workflows/apk-speaker-diarization.yaml +++ b/.github/workflows/apk-speaker-diarization.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-speaker-identification.yaml b/.github/workflows/apk-speaker-identification.yaml index c88718d6..9f2a7355 100644 --- a/.github/workflows/apk-speaker-identification.yaml +++ b/.github/workflows/apk-speaker-identification.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-spoken-language-identification.yaml b/.github/workflows/apk-spoken-language-identification.yaml index cc7525cd..363531d8 100644 --- a/.github/workflows/apk-spoken-language-identification.yaml +++ b/.github/workflows/apk-spoken-language-identification.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-tts-engine.yaml b/.github/workflows/apk-tts-engine.yaml index b8614cb7..43152a45 100644 --- a/.github/workflows/apk-tts-engine.yaml +++ b/.github/workflows/apk-tts-engine.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-tts.yaml b/.github/workflows/apk-tts.yaml index 1609739c..b392e6c8 100644 --- a/.github/workflows/apk-tts.yaml +++ b/.github/workflows/apk-tts.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-vad-asr-simulated-streaming.yaml b/.github/workflows/apk-vad-asr-simulated-streaming.yaml index 7b96b284..11f89f27 100644 --- a/.github/workflows/apk-vad-asr-simulated-streaming.yaml +++ b/.github/workflows/apk-vad-asr-simulated-streaming.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-vad-asr.yaml b/.github/workflows/apk-vad-asr.yaml index bf103111..3a8aea9f 100644 --- a/.github/workflows/apk-vad-asr.yaml +++ b/.github/workflows/apk-vad-asr.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/apk-vad.yaml b/.github/workflows/apk-vad.yaml index f1a4364f..6e9c8a28 100644 --- a/.github/workflows/apk-vad.yaml +++ b/.github/workflows/apk-vad.yaml @@ -31,6 +31,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/arm-linux-gnueabihf.yaml b/.github/workflows/arm-linux-gnueabihf.yaml index d1d394c9..b7cd2af9 100644 --- a/.github/workflows/arm-linux-gnueabihf.yaml +++ b/.github/workflows/arm-linux-gnueabihf.yaml @@ -44,6 +44,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/as_cmake_sub_project.yaml b/.github/workflows/as_cmake_sub_project.yaml index 0260c351..ae69ed1e 100644 --- a/.github/workflows/as_cmake_sub_project.yaml +++ b/.github/workflows/as_cmake_sub_project.yaml @@ -26,6 +26,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/build-wheels-aarch64-cuda.yaml b/.github/workflows/build-wheels-aarch64-cuda.yaml index 24f1c219..2d0c5784 100644 --- a/.github/workflows/build-wheels-aarch64-cuda.yaml +++ b/.github/workflows/build-wheels-aarch64-cuda.yaml @@ -27,6 +27,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels diff --git a/.github/workflows/build-wheels-aarch64-rknn.yaml b/.github/workflows/build-wheels-aarch64-rknn.yaml index 71edea74..9127f9df 100644 --- a/.github/workflows/build-wheels-aarch64-rknn.yaml +++ b/.github/workflows/build-wheels-aarch64-rknn.yaml @@ -25,6 +25,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/build-wheels-aarch64.yaml b/.github/workflows/build-wheels-aarch64.yaml index a9035462..a5d62586 100644 --- a/.github/workflows/build-wheels-aarch64.yaml +++ b/.github/workflows/build-wheels-aarch64.yaml @@ -29,6 +29,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels diff --git a/.github/workflows/build-wheels-armv7l.yaml b/.github/workflows/build-wheels-armv7l.yaml index 58a7cc89..5f861283 100644 --- a/.github/workflows/build-wheels-armv7l.yaml +++ b/.github/workflows/build-wheels-armv7l.yaml @@ -26,6 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: diff --git a/.github/workflows/build-wheels-linux-cuda.yaml b/.github/workflows/build-wheels-linux-cuda.yaml index bd322185..7675f1ce 100644 --- a/.github/workflows/build-wheels-linux-cuda.yaml +++ b/.github/workflows/build-wheels-linux-cuda.yaml @@ -26,6 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/build-wheels-linux.yaml b/.github/workflows/build-wheels-linux.yaml index a360a355..f4e76fe9 100644 --- a/.github/workflows/build-wheels-linux.yaml +++ b/.github/workflows/build-wheels-linux.yaml @@ -28,6 +28,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels diff --git a/.github/workflows/build-wheels-macos-arm64.yaml b/.github/workflows/build-wheels-macos-arm64.yaml index 77501043..ad5e9f72 100644 --- a/.github/workflows/build-wheels-macos-arm64.yaml +++ b/.github/workflows/build-wheels-macos-arm64.yaml @@ -26,6 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Build wheels uses: pypa/cibuildwheel@v2.21.3 env: diff --git a/.github/workflows/build-wheels-macos-universal2.yaml b/.github/workflows/build-wheels-macos-universal2.yaml index 68998f77..8a8f059e 100644 --- a/.github/workflows/build-wheels-macos-universal2.yaml +++ b/.github/workflows/build-wheels-macos-universal2.yaml @@ -26,6 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Build wheels uses: pypa/cibuildwheel@v2.21.3 env: diff --git a/.github/workflows/build-wheels-macos-x64.yaml b/.github/workflows/build-wheels-macos-x64.yaml index 9894fd1c..f83f6a08 100644 --- a/.github/workflows/build-wheels-macos-x64.yaml +++ b/.github/workflows/build-wheels-macos-x64.yaml @@ -26,6 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels diff --git a/.github/workflows/build-wheels-win32.yaml b/.github/workflows/build-wheels-win32.yaml index 732a17d7..b991e831 100644 --- a/.github/workflows/build-wheels-win32.yaml +++ b/.github/workflows/build-wheels-win32.yaml @@ -26,6 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ # for a list of versions - name: Build wheels diff --git a/.github/workflows/build-wheels-win64-cuda.yaml b/.github/workflows/build-wheels-win64-cuda.yaml index 612f25e8..b3e29bbd 100644 --- a/.github/workflows/build-wheels-win64-cuda.yaml +++ b/.github/workflows/build-wheels-win64-cuda.yaml @@ -26,6 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/build-wheels-win64.yaml b/.github/workflows/build-wheels-win64.yaml index 88358921..5f2c34b8 100644 --- a/.github/workflows/build-wheels-win64.yaml +++ b/.github/workflows/build-wheels-win64.yaml @@ -26,6 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/build-xcframework.yaml b/.github/workflows/build-xcframework.yaml index 8fcfafd4..f38d4216 100644 --- a/.github/workflows/build-xcframework.yaml +++ b/.github/workflows/build-xcframework.yaml @@ -43,6 +43,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Build iOS shared if: matrix.with_tts == 'ON' shell: bash diff --git a/.github/workflows/c-api-from-buffer.yaml b/.github/workflows/c-api-from-buffer.yaml index 5d9bc11d..0badb830 100644 --- a/.github/workflows/c-api-from-buffer.yaml +++ b/.github/workflows/c-api-from-buffer.yaml @@ -44,6 +44,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/c-api.yaml b/.github/workflows/c-api.yaml index a3e81279..e53e7b67 100644 --- a/.github/workflows/c-api.yaml +++ b/.github/workflows/c-api.yaml @@ -42,6 +42,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/clang-tidy.yaml b/.github/workflows/clang-tidy.yaml index 3295fc64..beac7c00 100644 --- a/.github/workflows/clang-tidy.yaml +++ b/.github/workflows/clang-tidy.yaml @@ -33,6 +33,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/cxx-api.yaml b/.github/workflows/cxx-api.yaml index d3441c81..f8d7b688 100644 --- a/.github/workflows/cxx-api.yaml +++ b/.github/workflows/cxx-api.yaml @@ -41,6 +41,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/dot-net.yaml b/.github/workflows/dot-net.yaml index 06f10c27..7537c602 100644 --- a/.github/workflows/dot-net.yaml +++ b/.github/workflows/dot-net.yaml @@ -25,6 +25,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Build sherpa-onnx shell: bash run: | diff --git a/.github/workflows/flutter-android.yaml b/.github/workflows/flutter-android.yaml index c2b1d01d..9dcbd506 100644 --- a/.github/workflows/flutter-android.yaml +++ b/.github/workflows/flutter-android.yaml @@ -27,6 +27,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Display NDK HOME shell: bash run: | diff --git a/.github/workflows/flutter-linux.yaml b/.github/workflows/flutter-linux.yaml index f1fdd5ec..82b30a6f 100644 --- a/.github/workflows/flutter-linux.yaml +++ b/.github/workflows/flutter-linux.yaml @@ -30,10 +30,16 @@ jobs: index: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install deps shell: bash run: | @@ -235,6 +241,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Retrieve artifact from ubuntu-latest uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/flutter-macos.yaml b/.github/workflows/flutter-macos.yaml index e85ff164..f8f4abb3 100644 --- a/.github/workflows/flutter-macos.yaml +++ b/.github/workflows/flutter-macos.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install Python dependencies shell: bash run: | @@ -134,6 +140,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install Python dependencies shell: bash run: | diff --git a/.github/workflows/flutter-windows-x64.yaml b/.github/workflows/flutter-windows-x64.yaml index 59f6a6af..1d02b59b 100644 --- a/.github/workflows/flutter-windows-x64.yaml +++ b/.github/workflows/flutter-windows-x64.yaml @@ -27,6 +27,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install Python dependencies shell: bash run: | @@ -125,6 +131,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install Python dependencies shell: bash run: | diff --git a/.github/workflows/hap-vad-asr.yaml b/.github/workflows/hap-vad-asr.yaml index 9e64a9ab..d0511386 100644 --- a/.github/workflows/hap-vad-asr.yaml +++ b/.github/workflows/hap-vad-asr.yaml @@ -32,6 +32,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + # https://github.com/actions/setup-java - uses: actions/setup-java@v4 with: diff --git a/.github/workflows/har.yaml b/.github/workflows/har.yaml index 7b5b2e51..15c03968 100644 --- a/.github/workflows/har.yaml +++ b/.github/workflows/har.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/harmony-os.yaml b/.github/workflows/harmony-os.yaml index e1a2ae1a..d493dfb9 100644 --- a/.github/workflows/harmony-os.yaml +++ b/.github/workflows/harmony-os.yaml @@ -29,6 +29,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/jni.yaml b/.github/workflows/jni.yaml index 3bce5cdc..e8eaea90 100644 --- a/.github/workflows/jni.yaml +++ b/.github/workflows/jni.yaml @@ -42,6 +42,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/lazarus.yaml b/.github/workflows/lazarus.yaml index d28b7cba..17bfbfc1 100644 --- a/.github/workflows/lazarus.yaml +++ b/.github/workflows/lazarus.yaml @@ -48,6 +48,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -259,6 +265,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Retrieve artifact from windows x64 uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/linux-gpu.yaml b/.github/workflows/linux-gpu.yaml index 72b0047e..220c8b66 100644 --- a/.github/workflows/linux-gpu.yaml +++ b/.github/workflows/linux-gpu.yaml @@ -56,6 +56,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Build sherpa-onnx uses: addnab/docker-run-action@v3 with: diff --git a/.github/workflows/linux-jni-aarch64.yaml b/.github/workflows/linux-jni-aarch64.yaml index 1877b2a6..8c5a7f79 100644 --- a/.github/workflows/linux-jni-aarch64.yaml +++ b/.github/workflows/linux-jni-aarch64.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - uses: actions/setup-java@v4 with: distribution: 'temurin' # See 'Supported distributions' for available options diff --git a/.github/workflows/linux-jni.yaml b/.github/workflows/linux-jni.yaml index b4ce5611..be4ea38b 100644 --- a/.github/workflows/linux-jni.yaml +++ b/.github/workflows/linux-jni.yaml @@ -27,6 +27,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - uses: actions/setup-java@v4 with: distribution: 'temurin' # See 'Supported distributions' for available options diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index ff796e21..dafd7cc8 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -74,6 +74,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Display PWD shell: bash run: | diff --git a/.github/workflows/macos-jni.yaml b/.github/workflows/macos-jni.yaml index a59c1c38..793c2ecf 100644 --- a/.github/workflows/macos-jni.yaml +++ b/.github/workflows/macos-jni.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - uses: actions/setup-java@v4 with: distribution: 'temurin' # See 'Supported distributions' for available options diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index ca7f0767..cc3d4e1f 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -71,6 +71,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/mfc.yaml b/.github/workflows/mfc.yaml index e8ba663f..3f7fd78b 100644 --- a/.github/workflows/mfc.yaml +++ b/.github/workflows/mfc.yaml @@ -43,6 +43,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Display MSBuild info shell: cmd run: | diff --git a/.github/workflows/mobile-asr-models.yaml b/.github/workflows/mobile-asr-models.yaml index aa2f03ef..0ebb6574 100644 --- a/.github/workflows/mobile-asr-models.yaml +++ b/.github/workflows/mobile-asr-models.yaml @@ -27,6 +27,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/mobile-kws-models.yaml b/.github/workflows/mobile-kws-models.yaml index b7ccda05..d204bb53 100644 --- a/.github/workflows/mobile-kws-models.yaml +++ b/.github/workflows/mobile-kws-models.yaml @@ -27,6 +27,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/nightly-wheel-arm.yaml b/.github/workflows/nightly-wheel-arm.yaml index 5d8a7cac..c873c95b 100644 --- a/.github/workflows/nightly-wheel-arm.yaml +++ b/.github/workflows/nightly-wheel-arm.yaml @@ -32,6 +32,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: diff --git a/.github/workflows/npm-addon-linux-aarch64.yaml b/.github/workflows/npm-addon-linux-aarch64.yaml index d72e760c..2be4902c 100644 --- a/.github/workflows/npm-addon-linux-aarch64.yaml +++ b/.github/workflows/npm-addon-linux-aarch64.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: diff --git a/.github/workflows/npm-addon-linux-x64.yaml b/.github/workflows/npm-addon-linux-x64.yaml index 3308c7c5..9a63108e 100644 --- a/.github/workflows/npm-addon-linux-x64.yaml +++ b/.github/workflows/npm-addon-linux-x64.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/npm-addon-macos.yaml b/.github/workflows/npm-addon-macos.yaml index 2cf6304e..4623be69 100644 --- a/.github/workflows/npm-addon-macos.yaml +++ b/.github/workflows/npm-addon-macos.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/npm-addon-win-x64.yaml b/.github/workflows/npm-addon-win-x64.yaml index 333ed3e9..8655c5af 100644 --- a/.github/workflows/npm-addon-win-x64.yaml +++ b/.github/workflows/npm-addon-win-x64.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/npm-addon-win-x86.yaml b/.github/workflows/npm-addon-win-x86.yaml index f997381c..85dc95a8 100644 --- a/.github/workflows/npm-addon-win-x86.yaml +++ b/.github/workflows/npm-addon-win-x86.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -144,6 +150,12 @@ jobs: 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' diff --git a/.github/workflows/npm-addon.yaml b/.github/workflows/npm-addon.yaml index 05c67591..3a14d5e2 100644 --- a/.github/workflows/npm-addon.yaml +++ b/.github/workflows/npm-addon.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/npm.yaml b/.github/workflows/npm.yaml index 9fd9f17a..b72c894f 100644 --- a/.github/workflows/npm.yaml +++ b/.github/workflows/npm.yaml @@ -28,6 +28,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/pascal.yaml b/.github/workflows/pascal.yaml index 807fa8ca..d45dbe3b 100644 --- a/.github/workflows/pascal.yaml +++ b/.github/workflows/pascal.yaml @@ -44,6 +44,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/pkg-config.yaml b/.github/workflows/pkg-config.yaml index 68459af0..2e40d776 100644 --- a/.github/workflows/pkg-config.yaml +++ b/.github/workflows/pkg-config.yaml @@ -46,6 +46,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/release-dart-package.yaml b/.github/workflows/release-dart-package.yaml index ef56e933..a54154a0 100644 --- a/.github/workflows/release-dart-package.yaml +++ b/.github/workflows/release-dart-package.yaml @@ -24,6 +24,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Fix version shell: bash run: | @@ -121,6 +127,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -223,6 +235,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Fix version shell: bash run: | @@ -307,6 +325,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -438,6 +462,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -517,6 +547,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Flutter SDK uses: flutter-actions/setup-flutter@v3 with: diff --git a/.github/workflows/release-go.yaml b/.github/workflows/release-go.yaml index b10cf251..c1b38fe3 100644 --- a/.github/workflows/release-go.yaml +++ b/.github/workflows/release-go.yaml @@ -15,6 +15,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Add SSH key run: | mkdir -p ~/.ssh/ diff --git a/.github/workflows/riscv64-linux.yaml b/.github/workflows/riscv64-linux.yaml index 7f21f98c..56f1bd9c 100644 --- a/.github/workflows/riscv64-linux.yaml +++ b/.github/workflows/riscv64-linux.yaml @@ -45,6 +45,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/rknn-linux-aarch64.yaml b/.github/workflows/rknn-linux-aarch64.yaml index 422212cf..d9cce8e6 100644 --- a/.github/workflows/rknn-linux-aarch64.yaml +++ b/.github/workflows/rknn-linux-aarch64.yaml @@ -49,6 +49,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/run-java-test.yaml b/.github/workflows/run-java-test.yaml index 3f3cbba2..73ec5e85 100644 --- a/.github/workflows/run-java-test.yaml +++ b/.github/workflows/run-java-test.yaml @@ -43,6 +43,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -105,6 +111,12 @@ jobs: make -j4 ls -lh lib + - name: Run java version test + shell: bash + run: | + cd ./java-api-examples + ./run-version-test.sh + - name: Run java test (Non-streaming SenseVoice with homophone replacer) shell: bash run: | diff --git a/.github/workflows/run-python-test-macos.yaml b/.github/workflows/run-python-test-macos.yaml index afcdee02..ed455a2c 100644 --- a/.github/workflows/run-python-test-macos.yaml +++ b/.github/workflows/run-python-test-macos.yaml @@ -60,6 +60,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Display OS version shell: bash run: | diff --git a/.github/workflows/run-python-test.yaml b/.github/workflows/run-python-test.yaml index 9cea32bd..66c59888 100644 --- a/.github/workflows/run-python-test.yaml +++ b/.github/workflows/run-python-test.yaml @@ -55,6 +55,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Display OS version shell: bash run: | diff --git a/.github/workflows/sanitizer.yaml b/.github/workflows/sanitizer.yaml index 7cda9689..19f97f5b 100644 --- a/.github/workflows/sanitizer.yaml +++ b/.github/workflows/sanitizer.yaml @@ -30,6 +30,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/speaker-diarization.yaml b/.github/workflows/speaker-diarization.yaml index ab2a4f09..6153dca6 100644 --- a/.github/workflows/speaker-diarization.yaml +++ b/.github/workflows/speaker-diarization.yaml @@ -25,6 +25,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/swift.yaml b/.github/workflows/swift.yaml index 35bb7ab3..55d13bd8 100644 --- a/.github/workflows/swift.yaml +++ b/.github/workflows/swift.yaml @@ -46,6 +46,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/test-build-wheel.yaml b/.github/workflows/test-build-wheel.yaml index ce18a3c5..e9d5efbc 100644 --- a/.github/workflows/test-build-wheel.yaml +++ b/.github/workflows/test-build-wheel.yaml @@ -80,6 +80,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/test-dart-package.yaml b/.github/workflows/test-dart-package.yaml index 4721f4a7..352bcb22 100644 --- a/.github/workflows/test-dart-package.yaml +++ b/.github/workflows/test-dart-package.yaml @@ -30,6 +30,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Flutter SDK uses: flutter-actions/setup-flutter@v3 with: diff --git a/.github/workflows/test-dart.yaml b/.github/workflows/test-dart.yaml index 3f667bea..a15560c7 100644 --- a/.github/workflows/test-dart.yaml +++ b/.github/workflows/test-dart.yaml @@ -39,6 +39,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/test-dot-net-nuget.yaml b/.github/workflows/test-dot-net-nuget.yaml index b89781be..c59099ea 100644 --- a/.github/workflows/test-dot-net-nuget.yaml +++ b/.github/workflows/test-dot-net-nuget.yaml @@ -32,6 +32,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Free space if: matrix.os == 'ubuntu-latest' shell: bash diff --git a/.github/workflows/test-dot-net.yaml b/.github/workflows/test-dot-net.yaml index 9b46b64d..21424767 100644 --- a/.github/workflows/test-dot-net.yaml +++ b/.github/workflows/test-dot-net.yaml @@ -45,6 +45,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -138,6 +144,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/test-go-package.yaml b/.github/workflows/test-go-package.yaml index 7eaa7deb..bf96d85e 100644 --- a/.github/workflows/test-go-package.yaml +++ b/.github/workflows/test-go-package.yaml @@ -45,6 +45,12 @@ jobs: with: go-version: '>=1.17' + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Display go version shell: bash run: | diff --git a/.github/workflows/test-go.yaml b/.github/workflows/test-go.yaml index d6bff9b1..afae7675 100644 --- a/.github/workflows/test-go.yaml +++ b/.github/workflows/test-go.yaml @@ -40,6 +40,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/test-nodejs-addon-api.yaml b/.github/workflows/test-nodejs-addon-api.yaml index 539025c8..677835ec 100644 --- a/.github/workflows/test-nodejs-addon-api.yaml +++ b/.github/workflows/test-nodejs-addon-api.yaml @@ -46,6 +46,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/test-nodejs-addon-npm-aarch64.yaml b/.github/workflows/test-nodejs-addon-npm-aarch64.yaml index 232f8fe2..540bcd32 100644 --- a/.github/workflows/test-nodejs-addon-npm-aarch64.yaml +++ b/.github/workflows/test-nodejs-addon-npm-aarch64.yaml @@ -47,6 +47,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: diff --git a/.github/workflows/test-nodejs-addon-npm-win-x86.yaml b/.github/workflows/test-nodejs-addon-npm-win-x86.yaml index 0a21630d..c5c47b7f 100644 --- a/.github/workflows/test-nodejs-addon-npm-win-x86.yaml +++ b/.github/workflows/test-nodejs-addon-npm-win-x86.yaml @@ -50,6 +50,12 @@ jobs: 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' diff --git a/.github/workflows/test-nodejs-addon-npm.yaml b/.github/workflows/test-nodejs-addon-npm.yaml index 34507164..d2b41464 100644 --- a/.github/workflows/test-nodejs-addon-npm.yaml +++ b/.github/workflows/test-nodejs-addon-npm.yaml @@ -48,6 +48,12 @@ jobs: 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' diff --git a/.github/workflows/test-nodejs-npm.yaml b/.github/workflows/test-nodejs-npm.yaml index 92f32b34..ceaad03d 100644 --- a/.github/workflows/test-nodejs-npm.yaml +++ b/.github/workflows/test-nodejs-npm.yaml @@ -33,6 +33,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/test-nodejs.yaml b/.github/workflows/test-nodejs.yaml index e2f7075a..2de666ff 100644 --- a/.github/workflows/test-nodejs.yaml +++ b/.github/workflows/test-nodejs.yaml @@ -46,6 +46,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/test-pip-install.yaml b/.github/workflows/test-pip-install.yaml index 2879c42b..9fef787c 100644 --- a/.github/workflows/test-pip-install.yaml +++ b/.github/workflows/test-pip-install.yaml @@ -81,6 +81,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: diff --git a/.github/workflows/test-piper-phonemize.yaml b/.github/workflows/test-piper-phonemize.yaml index 74409541..eee2619e 100644 --- a/.github/workflows/test-piper-phonemize.yaml +++ b/.github/workflows/test-piper-phonemize.yaml @@ -41,6 +41,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/test-python-offline-websocket-server.yaml b/.github/workflows/test-python-offline-websocket-server.yaml index d3e931ff..93b7fb59 100644 --- a/.github/workflows/test-python-offline-websocket-server.yaml +++ b/.github/workflows/test-python-offline-websocket-server.yaml @@ -42,6 +42,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/test-python-online-websocket-server.yaml b/.github/workflows/test-python-online-websocket-server.yaml index f5afa584..be55455c 100644 --- a/.github/workflows/test-python-online-websocket-server.yaml +++ b/.github/workflows/test-python-online-websocket-server.yaml @@ -42,6 +42,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: diff --git a/.github/workflows/wasm-simd-hf-space-de-tts.yaml b/.github/workflows/wasm-simd-hf-space-de-tts.yaml index 76013291..cf265378 100644 --- a/.github/workflows/wasm-simd-hf-space-de-tts.yaml +++ b/.github/workflows/wasm-simd-hf-space-de-tts.yaml @@ -26,6 +26,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/wasm-simd-hf-space-en-asr-zipformer.yaml b/.github/workflows/wasm-simd-hf-space-en-asr-zipformer.yaml index b6f3eb03..64ec4642 100644 --- a/.github/workflows/wasm-simd-hf-space-en-asr-zipformer.yaml +++ b/.github/workflows/wasm-simd-hf-space-en-asr-zipformer.yaml @@ -25,6 +25,13 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/wasm-simd-hf-space-en-tts.yaml b/.github/workflows/wasm-simd-hf-space-en-tts.yaml index d67ae881..b639706a 100644 --- a/.github/workflows/wasm-simd-hf-space-en-tts.yaml +++ b/.github/workflows/wasm-simd-hf-space-en-tts.yaml @@ -26,6 +26,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/wasm-simd-hf-space-silero-vad.yaml b/.github/workflows/wasm-simd-hf-space-silero-vad.yaml index 81052cac..a7d7b511 100644 --- a/.github/workflows/wasm-simd-hf-space-silero-vad.yaml +++ b/.github/workflows/wasm-simd-hf-space-silero-vad.yaml @@ -26,6 +26,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/wasm-simd-hf-space-speaker-diarization.yaml b/.github/workflows/wasm-simd-hf-space-speaker-diarization.yaml index 14301f9f..67b6682d 100644 --- a/.github/workflows/wasm-simd-hf-space-speaker-diarization.yaml +++ b/.github/workflows/wasm-simd-hf-space-speaker-diarization.yaml @@ -27,6 +27,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/wasm-simd-hf-space-speech-enhancement-gtcrn.yaml b/.github/workflows/wasm-simd-hf-space-speech-enhancement-gtcrn.yaml index 3de86fa9..eb55c475 100644 --- a/.github/workflows/wasm-simd-hf-space-speech-enhancement-gtcrn.yaml +++ b/.github/workflows/wasm-simd-hf-space-speech-enhancement-gtcrn.yaml @@ -27,6 +27,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/wasm-simd-hf-space-vad-asr.yaml b/.github/workflows/wasm-simd-hf-space-vad-asr.yaml index 8daa3121..f446b68e 100644 --- a/.github/workflows/wasm-simd-hf-space-vad-asr.yaml +++ b/.github/workflows/wasm-simd-hf-space-vad-asr.yaml @@ -29,6 +29,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install Python dependencies shell: bash run: | diff --git a/.github/workflows/wasm-simd-hf-space-zh-cantonese-en-asr-paraformer.yaml b/.github/workflows/wasm-simd-hf-space-zh-cantonese-en-asr-paraformer.yaml index 02a328a9..a0b97eb9 100644 --- a/.github/workflows/wasm-simd-hf-space-zh-cantonese-en-asr-paraformer.yaml +++ b/.github/workflows/wasm-simd-hf-space-zh-cantonese-en-asr-paraformer.yaml @@ -26,6 +26,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/wasm-simd-hf-space-zh-en-asr-paraformer.yaml b/.github/workflows/wasm-simd-hf-space-zh-en-asr-paraformer.yaml index 1a72be6a..4c5ebe84 100644 --- a/.github/workflows/wasm-simd-hf-space-zh-en-asr-paraformer.yaml +++ b/.github/workflows/wasm-simd-hf-space-zh-en-asr-paraformer.yaml @@ -26,6 +26,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/wasm-simd-hf-space-zh-en-asr-zipformer.yaml b/.github/workflows/wasm-simd-hf-space-zh-en-asr-zipformer.yaml index 8b7c2029..ea0205fd 100644 --- a/.github/workflows/wasm-simd-hf-space-zh-en-asr-zipformer.yaml +++ b/.github/workflows/wasm-simd-hf-space-zh-en-asr-zipformer.yaml @@ -26,6 +26,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Install emsdk uses: mymindstorm/setup-emsdk@v14 with: diff --git a/.github/workflows/windows-arm64.yaml b/.github/workflows/windows-arm64.yaml index b6ab5bf7..8ab23998 100644 --- a/.github/workflows/windows-arm64.yaml +++ b/.github/workflows/windows-arm64.yaml @@ -40,6 +40,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Configure CMake shell: bash run: | diff --git a/.github/workflows/windows-x64-cuda.yaml b/.github/workflows/windows-x64-cuda.yaml index 0d15af94..0a4f1484 100644 --- a/.github/workflows/windows-x64-cuda.yaml +++ b/.github/workflows/windows-x64-cuda.yaml @@ -50,6 +50,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Configure CMake shell: bash run: | diff --git a/.github/workflows/windows-x64-debug.yaml b/.github/workflows/windows-x64-debug.yaml index 7abf0228..c3039a65 100644 --- a/.github/workflows/windows-x64-debug.yaml +++ b/.github/workflows/windows-x64-debug.yaml @@ -52,6 +52,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Configure CMake shell: bash run: | diff --git a/.github/workflows/windows-x64-jni.yaml b/.github/workflows/windows-x64-jni.yaml index 85d3ad7f..d20fb223 100644 --- a/.github/workflows/windows-x64-jni.yaml +++ b/.github/workflows/windows-x64-jni.yaml @@ -27,6 +27,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - uses: actions/setup-java@v4 with: distribution: 'temurin' # See 'Supported distributions' for available options diff --git a/.github/workflows/windows-x64.yaml b/.github/workflows/windows-x64.yaml index 1ab84c82..9757648c 100644 --- a/.github/workflows/windows-x64.yaml +++ b/.github/workflows/windows-x64.yaml @@ -64,6 +64,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Configure CMake shell: bash run: | diff --git a/.github/workflows/windows-x86-debug.yaml b/.github/workflows/windows-x86-debug.yaml index 59d9ef37..5c923c96 100644 --- a/.github/workflows/windows-x86-debug.yaml +++ b/.github/workflows/windows-x86-debug.yaml @@ -52,6 +52,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Configure CMake shell: bash run: | diff --git a/.github/workflows/windows-x86.yaml b/.github/workflows/windows-x86.yaml index 2dedc05e..d2e6e48c 100644 --- a/.github/workflows/windows-x86.yaml +++ b/.github/workflows/windows-x86.yaml @@ -64,6 +64,12 @@ jobs: with: fetch-depth: 0 + - name: Update version + shell: bash + run: | + ./new-release.sh + git diff . + - name: Configure CMake shell: bash run: | diff --git a/android/SherpaOnnxAar/sherpa_onnx/src/main/java/com/k2fsa/sherpa/onnx/VersionInfo.kt b/android/SherpaOnnxAar/sherpa_onnx/src/main/java/com/k2fsa/sherpa/onnx/VersionInfo.kt new file mode 120000 index 00000000..d384e0da --- /dev/null +++ b/android/SherpaOnnxAar/sherpa_onnx/src/main/java/com/k2fsa/sherpa/onnx/VersionInfo.kt @@ -0,0 +1 @@ +../../../../../../../../../../sherpa-onnx/kotlin-api/VersionInfo.kt \ No newline at end of file diff --git a/cmake/cmake_extension.py b/cmake/cmake_extension.py index 457b847d..1810ddbd 100644 --- a/cmake/cmake_extension.py +++ b/cmake/cmake_extension.py @@ -68,6 +68,7 @@ def get_binaries(): "sherpa-onnx-vad-microphone", "sherpa-onnx-vad-microphone-offline-asr", "sherpa-onnx-vad-with-offline-asr", + "sherpa-onnx-version", ] if enable_alsa(): diff --git a/dart-api-examples/non-streaming-asr/bin/sense-voice-with-hr.dart b/dart-api-examples/non-streaming-asr/bin/sense-voice-with-hr.dart index 85a80739..86609800 100644 --- a/dart-api-examples/non-streaming-asr/bin/sense-voice-with-hr.dart +++ b/dart-api-examples/non-streaming-asr/bin/sense-voice-with-hr.dart @@ -9,6 +9,10 @@ import './init.dart'; void main(List arguments) async { await initSherpaOnnx(); + print('sherpa-onnx version: ${sherpa_onnx.getVersion()}'); + print('sherpa-onnx gitSha1: ${sherpa_onnx.getGitSha1()}'); + print('sherpa-onnx gitDate: ${sherpa_onnx.getGitDate()}'); + final parser = ArgParser() ..addOption('model', help: 'Path to the SenseVoice model') ..addOption('tokens', help: 'Path to tokens.txt') diff --git a/dotnet-examples/sherpa-onnx.sln b/dotnet-examples/sherpa-onnx.sln index 0c8e24ab..65706b87 100644 --- a/dotnet-examples/sherpa-onnx.sln +++ b/dotnet-examples/sherpa-onnx.sln @@ -37,6 +37,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kokoro-tts-play", "kokoro-t EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "speech-enhancement-gtcrn", "speech-enhancement-gtcrn\speech-enhancement-gtcrn.csproj", "{DF2569C6-6011-4716-9538-F9E9069E00EB}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "version-test", "version-test\version-test.csproj", "{E57711E5-6546-4BA0-B627-79C94F415BC5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -111,6 +113,10 @@ Global {DF2569C6-6011-4716-9538-F9E9069E00EB}.Debug|Any CPU.Build.0 = Debug|Any CPU {DF2569C6-6011-4716-9538-F9E9069E00EB}.Release|Any CPU.ActiveCfg = Release|Any CPU {DF2569C6-6011-4716-9538-F9E9069E00EB}.Release|Any CPU.Build.0 = Release|Any CPU + {E57711E5-6546-4BA0-B627-79C94F415BC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E57711E5-6546-4BA0-B627-79C94F415BC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E57711E5-6546-4BA0-B627-79C94F415BC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E57711E5-6546-4BA0-B627-79C94F415BC5}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/dotnet-examples/version-test/Program.cs b/dotnet-examples/version-test/Program.cs new file mode 100644 index 00000000..732fc877 --- /dev/null +++ b/dotnet-examples/version-test/Program.cs @@ -0,0 +1,16 @@ +// Copyright (c) 2025 Xiaomi Corporation +using SherpaOnnx; + +class VersionTestDemo +{ + static void Main(string[] args) + { + var version = VersionInfo.Version; + var gitSha1 = VersionInfo.GitSha1; + var gitDate = VersionInfo.GitDate; + + Console.WriteLine("sherpa-onnx version: {0}", version); + Console.WriteLine("sherpa-onnx gitSha1: {0}", gitSha1); + Console.WriteLine("sherpa-onnx gitDate: {0}", gitDate); + } +} diff --git a/dotnet-examples/version-test/run.sh b/dotnet-examples/version-test/run.sh new file mode 100755 index 00000000..3e9f255b --- /dev/null +++ b/dotnet-examples/version-test/run.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -ex + +dotnet run diff --git a/dotnet-examples/version-test/version-test.csproj b/dotnet-examples/version-test/version-test.csproj new file mode 100644 index 00000000..b49cd896 --- /dev/null +++ b/dotnet-examples/version-test/version-test.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + version_test + enable + enable + + + + + + + diff --git a/flutter/sherpa_onnx/lib/sherpa_onnx.dart b/flutter/sherpa_onnx/lib/sherpa_onnx.dart index ba2044f3..e6c4281e 100644 --- a/flutter/sherpa_onnx/lib/sherpa_onnx.dart +++ b/flutter/sherpa_onnx/lib/sherpa_onnx.dart @@ -17,6 +17,7 @@ export 'src/online_stream.dart'; export 'src/speaker_identification.dart'; export 'src/tts.dart'; export 'src/vad.dart'; +export 'src/version.dart'; export 'src/wave_reader.dart'; export 'src/wave_writer.dart'; diff --git a/flutter/sherpa_onnx/lib/src/sherpa_onnx_bindings.dart b/flutter/sherpa_onnx/lib/src/sherpa_onnx_bindings.dart index 71921a8d..48977f29 100644 --- a/flutter/sherpa_onnx/lib/src/sherpa_onnx_bindings.dart +++ b/flutter/sherpa_onnx/lib/src/sherpa_onnx_bindings.dart @@ -1250,6 +1250,15 @@ typedef SherpaOnnxFreeWaveNative = Void Function(Pointer); typedef SherpaOnnxFreeWave = void Function(Pointer); +typedef SherpaOnnxGetVersionStr = Pointer Function(); +typedef SherpaOnnxGetVersionStrNative = SherpaOnnxGetVersionStr; + +typedef SherpaOnnxGetGitSha1Native = Pointer Function(); +typedef SherpaOnnxGetGitSha1 = SherpaOnnxGetGitSha1Native; + +typedef SherpaOnnxGetGitDateNative = Pointer Function(); +typedef SherpaOnnxGetGitDate = SherpaOnnxGetGitDateNative; + class SherpaOnnxBindings { static SherpaOnnxCreateOfflineSpeechDenoiser? sherpaOnnxCreateOfflineSpeechDenoiser; @@ -1459,6 +1468,10 @@ class SherpaOnnxBindings { static SherpaOnnxFreeWave? freeWave; + static SherpaOnnxGetVersionStr? getVersionStr; + static SherpaOnnxGetGitSha1? getGitSha1; + static SherpaOnnxGetGitDate? getGitDate; + static void init(DynamicLibrary dynamicLibrary) { sherpaOnnxCreateOfflineSpeechDenoiser ??= dynamicLibrary .lookup>( @@ -2050,5 +2063,20 @@ class SherpaOnnxBindings { freeWave ??= dynamicLibrary .lookup>('SherpaOnnxFreeWave') .asFunction(); + + getVersionStr ??= dynamicLibrary + .lookup>( + 'SherpaOnnxGetVersionStr') + .asFunction(); + + getGitSha1 ??= dynamicLibrary + .lookup>( + 'SherpaOnnxGetGitSha1') + .asFunction(); + + getGitDate ??= dynamicLibrary + .lookup>( + 'SherpaOnnxGetGitDate') + .asFunction(); } } diff --git a/flutter/sherpa_onnx/lib/src/version.dart b/flutter/sherpa_onnx/lib/src/version.dart new file mode 100644 index 00000000..c8866798 --- /dev/null +++ b/flutter/sherpa_onnx/lib/src/version.dart @@ -0,0 +1,31 @@ +// Copyright (c) 2025 Xiaomi Corporation +import 'dart:ffi'; +import 'package:ffi/ffi.dart'; +import './sherpa_onnx_bindings.dart'; + +String getVersion() { + Pointer version = SherpaOnnxBindings.getVersionStr?.call() ?? nullptr; + if (version == nullptr) { + return ''; + } + + return version.toDartString(); +} + +String getGitSha1() { + Pointer gitSha1 = SherpaOnnxBindings.getGitSha1?.call() ?? nullptr; + if (gitSha1 == nullptr) { + return ''; + } + + return gitSha1.toDartString(); +} + +String getGitDate() { + Pointer gitDate = SherpaOnnxBindings.getGitDate?.call() ?? nullptr; + if (gitDate == nullptr) { + return ''; + } + + return gitDate.toDartString(); +} diff --git a/go-api-examples/streaming-decode-files/main.go b/go-api-examples/streaming-decode-files/main.go index f49b2ab6..2c2a4996 100644 --- a/go-api-examples/streaming-decode-files/main.go +++ b/go-api-examples/streaming-decode-files/main.go @@ -12,6 +12,10 @@ import ( ) func main() { + log.Printf("sherpa-onnx version: %v\n", sherpa.GetVersion()) + log.Printf("sherpa-onnx gitSha1: %v\n", sherpa.GetGitSha1()) + log.Printf("sherpa-onnx gitDate: %v\n", sherpa.GetGitDate()) + log.SetFlags(log.LstdFlags | log.Lmicroseconds) config := sherpa.OnlineRecognizerConfig{} diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt index 298f9d38..4b62ca1c 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/CMakeLists.txt @@ -53,6 +53,7 @@ add_library(sherpa_onnx SHARED streaming-asr.cc utils.cc vad.cc + version.cc wave-reader.cc wave-writer.cc ) diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/sherpa-onnx-node-addon-api.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/sherpa-onnx-node-addon-api.cc index d9f5dae5..5a2766d9 100644 --- a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/sherpa-onnx-node-addon-api.cc +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/sherpa-onnx-node-addon-api.cc @@ -29,6 +29,8 @@ void InitNonStreamingSpeakerDiarization(Napi::Env env, Napi::Object exports); void InitNonStreamingSpeechDenoiser(Napi::Env env, Napi::Object exports); +void InitVersion(Napi::Env env, Napi::Object exports); + #if __OHOS__ void InitUtils(Napi::Env env, Napi::Object exports); #endif @@ -47,6 +49,7 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { InitKeywordSpotting(env, exports); InitNonStreamingSpeakerDiarization(env, exports); InitNonStreamingSpeechDenoiser(env, exports); + InitVersion(env, exports); #if __OHOS__ InitUtils(env, exports); diff --git a/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/version.cc b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/version.cc new file mode 100644 index 00000000..ab9ce522 --- /dev/null +++ b/harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/version.cc @@ -0,0 +1,17 @@ +// scripts/node-addon-api/src/version.cc +// +// Copyright (c) 2025 Xiaomi Corporation +#include + +#include "napi.h" // NOLINT +#include "sherpa-onnx/c-api/c-api.h" + +void InitVersion(Napi::Env env, Napi::Object exports) { + Napi::String version = Napi::String::New(env, SherpaOnnxGetVersionStr()); + Napi::String git_sha1 = Napi::String::New(env, SherpaOnnxGetGitSha1()); + Napi::String git_date = Napi::String::New(env, SherpaOnnxGetGitDate()); + + exports.Set(Napi::String::New(env, "version"), version); + exports.Set(Napi::String::New(env, "gitSha1"), git_sha1); + exports.Set(Napi::String::New(env, "gitDate"), git_date); +} diff --git a/java-api-examples/VersionTest.java b/java-api-examples/VersionTest.java new file mode 100644 index 00000000..7ea54ffc --- /dev/null +++ b/java-api-examples/VersionTest.java @@ -0,0 +1,11 @@ +// Copyright 2025 Xiaomi Corporation + +import com.k2fsa.sherpa.onnx.*; + +public class VersionTest { + public static void main(String[] args) { + System.out.printf("sherpa-onnx version: %s\n", VersionInfo.getVersion()); + System.out.printf("sherpa-onnx gitSha1: %s\n", VersionInfo.getGitSha1()); + System.out.printf("sherpa-onnx gitDate: %s\n", VersionInfo.getGitDate()); + } +} diff --git a/java-api-examples/run-version-test.sh b/java-api-examples/run-version-test.sh new file mode 100755 index 00000000..80e040b7 --- /dev/null +++ b/java-api-examples/run-version-test.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -ex + +if [[ ! -f ../build/lib/libsherpa-onnx-jni.dylib && ! -f ../build/lib/libsherpa-onnx-jni.so ]]; then + mkdir -p ../build + pushd ../build + cmake \ + -DSHERPA_ONNX_ENABLE_PYTHON=OFF \ + -DSHERPA_ONNX_ENABLE_TESTS=OFF \ + -DSHERPA_ONNX_ENABLE_CHECK=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DSHERPA_ONNX_ENABLE_PORTAUDIO=OFF \ + -DSHERPA_ONNX_ENABLE_JNI=ON \ + .. + + make -j4 + ls -lh lib + popd +fi + +if [ ! -f ../sherpa-onnx/java-api/build/sherpa-onnx.jar ]; then + pushd ../sherpa-onnx/java-api + make + popd +fi + +java \ + -Djava.library.path=$PWD/../build/lib \ + -cp ../sherpa-onnx/java-api/build/sherpa-onnx.jar \ + ./VersionTest.java + diff --git a/kotlin-api-examples/VersionInfo.kt b/kotlin-api-examples/VersionInfo.kt new file mode 120000 index 00000000..97fb3ac5 --- /dev/null +++ b/kotlin-api-examples/VersionInfo.kt @@ -0,0 +1 @@ +../sherpa-onnx/kotlin-api/VersionInfo.kt \ No newline at end of file diff --git a/kotlin-api-examples/run.sh b/kotlin-api-examples/run.sh index 6fde6f2d..1cc4e64f 100755 --- a/kotlin-api-examples/run.sh +++ b/kotlin-api-examples/run.sh @@ -25,6 +25,18 @@ if [[ ! -f ../build/lib/libsherpa-onnx-jni.dylib && ! -f ../build/lib/libsherpa fi export LD_LIBRARY_PATH=$PWD/build/lib:$LD_LIBRARY_PATH +echo $LD_LIBRARY_PATH + +function testVersion() { + out_filename=test_version.jar + kotlinc-jvm -include-runtime -d $out_filename \ + test_version.kt \ + VersionInfo.kt + + ls -lh $out_filename + + java -Djava.library.path=../build/lib -jar $out_filename +} function testSpeakerEmbeddingExtractor() { if [ ! -f ./3dspeaker_speech_eres2net_large_sv_zh-cn_3dspeaker_16k.onnx ]; then @@ -436,6 +448,7 @@ function testOfflineSenseVoiceWithHr() { ls -lh $out_filename java -Djava.library.path=../build/lib -jar $out_filename } +testVersion testOfflineSenseVoiceWithHr testOfflineSpeechDenoiser diff --git a/kotlin-api-examples/test_version.kt b/kotlin-api-examples/test_version.kt new file mode 100644 index 00000000..baf3eb83 --- /dev/null +++ b/kotlin-api-examples/test_version.kt @@ -0,0 +1,8 @@ +package com.k2fsa.sherpa.onnx + +fun main() { + println("sherpa-onnx version: ${VersionInfo.version}"); + println("sherpa-onnx gitSha1: ${VersionInfo.gitSha1}"); + println("sherpa-onnx gitDate: ${VersionInfo.gitDate}"); +} + diff --git a/new-release.sh b/new-release.sh index 6207e518..618addee 100755 --- a/new-release.sh +++ b/new-release.sh @@ -2,6 +2,13 @@ set -ex +sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./sherpa-onnx/csrc/version.cc +sha1=$(git describe --match=NeVeRmAtCh --always --abbrev=8) +date=$(git log -1 --format=%ad --date=local) + +sed -i.bak "s/ static const char \*sha1.*/ static const char \*sha1 = \"$sha1\";/g" ./sherpa-onnx/csrc/version.cc +sed -i.bak "s/ static const char \*date.*/ static const char \*date = \"$date\";/g" ./sherpa-onnx/csrc/version.cc + sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./build-ios-shared.sh sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./pom.xml sed -i.bak 's/1\.12\.0/1\.12\.1/g' ./jitpack.yml diff --git a/nodejs-addon-examples/test_asr_non_streaming_whisper.js b/nodejs-addon-examples/test_asr_non_streaming_whisper.js index 7c7c3ca7..411bb455 100644 --- a/nodejs-addon-examples/test_asr_non_streaming_whisper.js +++ b/nodejs-addon-examples/test_asr_non_streaming_whisper.js @@ -1,5 +1,8 @@ // Copyright (c) 2024 Xiaomi Corporation const sherpa_onnx = require('sherpa-onnx-node'); +console.log(`verison : ${sherpa_onnx.version}`); +console.log(`git sha1: ${sherpa_onnx.gitSha1}`); +console.log(`git date: ${sherpa_onnx.gitDate}`); // Please download test files from // https://github.com/k2-fsa/sherpa-onnx/releases/tag/asr-models diff --git a/nodejs-examples/test-offline-whisper.js b/nodejs-examples/test-offline-whisper.js index c4b08427..a685f50d 100644 --- a/nodejs-examples/test-offline-whisper.js +++ b/nodejs-examples/test-offline-whisper.js @@ -1,6 +1,9 @@ // Copyright (c) 2023 Xiaomi Corporation (authors: Fangjun Kuang) // const sherpa_onnx = require('sherpa-onnx'); +console.log(`verison : ${sherpa_onnx.version}`); +console.log(`git sha1: ${sherpa_onnx.gitSha1}`); +console.log(`git date: ${sherpa_onnx.gitDate}`); function createOfflineRecognizer() { let modelConfig = { diff --git a/pascal-api-examples/non-streaming-asr/.gitignore b/pascal-api-examples/non-streaming-asr/.gitignore index aba0585a..8b3ee37d 100644 --- a/pascal-api-examples/non-streaming-asr/.gitignore +++ b/pascal-api-examples/non-streaming-asr/.gitignore @@ -8,3 +8,4 @@ paraformer_itn sense_voice telespeech_ctc moonshine +dolphin_ctc diff --git a/pascal-api-examples/non-streaming-asr/sense_voice.pas b/pascal-api-examples/non-streaming-asr/sense_voice.pas index 29a6c196..eeadb578 100644 --- a/pascal-api-examples/non-streaming-asr/sense_voice.pas +++ b/pascal-api-examples/non-streaming-asr/sense_voice.pas @@ -62,6 +62,9 @@ begin Duration := Length(Wave.Samples) / Wave.SampleRate; RealTimeFactor := Elapsed / Duration; + WriteLn(Format('sherpa-onnx version: %s', [SherpaOnnxGetVersionStr()])); + WriteLn(Format('sherpa-onnx gitSha1: %s', [SherpaOnnxGetGitSha1()])); + WriteLn(Format('sherpa-onnx gitDate: %s', [SherpaOnnxGetGitDate()])); WriteLn(RecognitionResult.ToString); WriteLn(Format('NumThreads %d', [Config.ModelConfig.NumThreads])); WriteLn(Format('Elapsed %.3f s', [Elapsed])); diff --git a/scripts/dotnet/VersionInfo.cs b/scripts/dotnet/VersionInfo.cs new file mode 100644 index 00000000..02248d74 --- /dev/null +++ b/scripts/dotnet/VersionInfo.cs @@ -0,0 +1,120 @@ +/// Copyright (c) 2025 Xiaomi Corporation (authors: Fangjun Kuang) +using System; +using System.Runtime.InteropServices; +using System.Text; + + +namespace SherpaOnnx +{ + public class VersionInfo + { + public static String Version + { + get + { + IntPtr p = SherpaOnnxGetVersionStr(); + + string s = ""; + int length = 0; + + unsafe + { + byte* b = (byte*)p; + if (b != null) + { + while (*b != 0) + { + ++b; + length += 1; + } + } + } + + if (length > 0) + { + byte[] stringBuffer = new byte[length]; + Marshal.Copy(p, stringBuffer, 0, length); + s = Encoding.UTF8.GetString(stringBuffer); + } + + return s; + } + } + + public static String GitSha1 + { + get + { + IntPtr p = SherpaOnnxGetGitSha1(); + + string s = ""; + int length = 0; + + unsafe + { + byte* b = (byte*)p; + if (b != null) + { + while (*b != 0) + { + ++b; + length += 1; + } + } + } + + if (length > 0) + { + byte[] stringBuffer = new byte[length]; + Marshal.Copy(p, stringBuffer, 0, length); + s = Encoding.UTF8.GetString(stringBuffer); + } + + return s; + } + } + + public static String GitDate + { + get + { + IntPtr p = SherpaOnnxGetGitDate(); + + string s = ""; + int length = 0; + + unsafe + { + byte* b = (byte*)p; + if (b != null) + { + while (*b != 0) + { + ++b; + length += 1; + } + } + } + + if (length > 0) + { + byte[] stringBuffer = new byte[length]; + Marshal.Copy(p, stringBuffer, 0, length); + s = Encoding.UTF8.GetString(stringBuffer); + } + + return s; + } + } + + + [DllImport(Dll.Filename)] + private static extern IntPtr SherpaOnnxGetVersionStr(); + + [DllImport(Dll.Filename)] + private static extern IntPtr SherpaOnnxGetGitSha1(); + + [DllImport(Dll.Filename)] + private static extern IntPtr SherpaOnnxGetGitDate(); + } +} diff --git a/scripts/go/sherpa_onnx.go b/scripts/go/sherpa_onnx.go index 01dcaab5..320bdcba 100644 --- a/scripts/go/sherpa_onnx.go +++ b/scripts/go/sherpa_onnx.go @@ -2027,3 +2027,15 @@ func (audio *DenoisedAudio) Save(filename string) bool { func (sd *OfflineSpeechDenoiser) SampleRate() int { return int(C.SherpaOnnxOfflineSpeechDenoiserGetSampleRate(sd.impl)) } + +func GetVersion() string { + return C.GoString(C.SherpaOnnxGetVersionStr()) +} + +func GetGitSha1() string { + return C.GoString(C.SherpaOnnxGetGitSha1()) +} + +func GetGitDate() string { + return C.GoString(C.SherpaOnnxGetGitDate()) +} diff --git a/scripts/node-addon-api/CMakeLists.txt b/scripts/node-addon-api/CMakeLists.txt index cf391cfa..135116d6 100644 --- a/scripts/node-addon-api/CMakeLists.txt +++ b/scripts/node-addon-api/CMakeLists.txt @@ -28,6 +28,7 @@ set(srcs src/spoken-language-identification.cc src/streaming-asr.cc src/vad.cc + src/version.cc src/wave-reader.cc src/wave-writer.cc ) diff --git a/scripts/node-addon-api/lib/addon.js b/scripts/node-addon-api/lib/addon.js index 840ead71..3fdd637f 100644 --- a/scripts/node-addon-api/lib/addon.js +++ b/scripts/node-addon-api/lib/addon.js @@ -26,12 +26,14 @@ for (const p of possible_paths) { } if (!found) { - let addon_path = `${process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`; + let addon_path = + `${process.env.PWD}/node_modules/sherpa-onnx-${platform_arch}`; const pnpmIndex = __dirname.indexOf(`node_modules${path.sep}.pnpm`); if (pnpmIndex !== -1) { const parts = __dirname.slice(pnpmIndex).split(path.sep); parts.pop(); - addon_path = `${process.env.PWD}/${parts.join('/')}/sherpa-onnx-${platform_arch}`; + addon_path = + `${process.env.PWD}/${parts.join('/')}/sherpa-onnx-${platform_arch}`; } let msg = `Could not find sherpa-onnx-node. Tried\n\n ${ diff --git a/scripts/node-addon-api/lib/sherpa-onnx.js b/scripts/node-addon-api/lib/sherpa-onnx.js index 0ad3afe0..d718aea8 100644 --- a/scripts/node-addon-api/lib/sherpa-onnx.js +++ b/scripts/node-addon-api/lib/sherpa-onnx.js @@ -28,4 +28,7 @@ module.exports = { KeywordSpotter: kws.KeywordSpotter, OfflineSpeakerDiarization: sd.OfflineSpeakerDiarization, OfflineSpeechDenoiser: speech_denoiser.OfflineSpeechDenoiser, + version: addon.version, + gitSha1: addon.gitSha1, + gitDate: addon.gitDate, } diff --git a/scripts/node-addon-api/src/version.cc b/scripts/node-addon-api/src/version.cc new file mode 120000 index 00000000..1b25717d --- /dev/null +++ b/scripts/node-addon-api/src/version.cc @@ -0,0 +1 @@ +../../../harmony-os/SherpaOnnxHar/sherpa_onnx/src/main/cpp/version.cc \ No newline at end of file diff --git a/scripts/nodejs/index.js b/scripts/nodejs/index.js index cbc88166..7192b1e3 100644 --- a/scripts/nodejs/index.js +++ b/scripts/nodejs/index.js @@ -60,6 +60,21 @@ function createOfflineSpeechDenoiser(config) { wasmModule, config); } +function getVersion() { + const v = wasmModule._SherpaOnnxGetVersionStr(); + return wasmModule.UTF8ToString(v); +} + +function getGitSha1() { + const v = wasmModule._SherpaOnnxGetGitSha1(); + return wasmModule.UTF8ToString(v); +} + +function getGitDate() { + const v = wasmModule._SherpaOnnxGetGitDate(); + return wasmModule.UTF8ToString(v); +} + // Note: online means streaming and offline means non-streaming here. // Both of them don't require internet connection. module.exports = { @@ -74,4 +89,7 @@ module.exports = { createVad, createOfflineSpeakerDiarization, createOfflineSpeechDenoiser, + version: getVersion(), + gitSha1: getGitSha1(), + gitDate: getGitDate(), }; diff --git a/sherpa-onnx/c-api/c-api.cc b/sherpa-onnx/c-api/c-api.cc index d442ce38..2739b5f4 100644 --- a/sherpa-onnx/c-api/c-api.cc +++ b/sherpa-onnx/c-api/c-api.cc @@ -32,6 +32,7 @@ #include "sherpa-onnx/csrc/speaker-embedding-manager.h" #include "sherpa-onnx/csrc/spoken-language-identification.h" #include "sherpa-onnx/csrc/text-utils.h" +#include "sherpa-onnx/csrc/version.h" #include "sherpa-onnx/csrc/voice-activity-detector.h" #include "sherpa-onnx/csrc/wave-reader.h" #include "sherpa-onnx/csrc/wave-writer.h" @@ -44,6 +45,10 @@ #include "sherpa-onnx/csrc/offline-speaker-diarization.h" #endif +const char *SherpaOnnxGetVersionStr() { return sherpa_onnx::GetVersionStr(); } +const char *SherpaOnnxGetGitSha1() { return sherpa_onnx::GetGitSha1(); } +const char *SherpaOnnxGetGitDate() { return sherpa_onnx::GetGitDate(); } + struct SherpaOnnxOnlineRecognizer { std::unique_ptr impl; }; @@ -1369,9 +1374,8 @@ int64_t SherpaOnnxWaveFileSize(int32_t n_samples) { return sherpa_onnx::WaveFileSize(n_samples); } -SHERPA_ONNX_API void SherpaOnnxWriteWaveToBuffer(const float *samples, - int32_t n, int32_t sample_rate, - char *buffer) { +void SherpaOnnxWriteWaveToBuffer(const float *samples, int32_t n, + int32_t sample_rate, char *buffer) { sherpa_onnx::WriteWave(buffer, sample_rate, samples, n); } diff --git a/sherpa-onnx/c-api/c-api.h b/sherpa-onnx/c-api/c-api.h index 920d0e9b..02df4372 100644 --- a/sherpa-onnx/c-api/c-api.h +++ b/sherpa-onnx/c-api/c-api.h @@ -47,6 +47,30 @@ extern "C" { #define SHERPA_ONNX_API SHERPA_ONNX_IMPORT #endif +// Please don't free the returned pointer. +// Please don't modify the memory pointed by the returned pointer. +// +// The memory pointed by the returned pointer is statically allocated. +// +// Example return value: "1.12.1" +SHERPA_ONNX_API const char *SherpaOnnxGetVersionStr(); + +// Please don't free the returned pointer. +// Please don't modify the memory pointed by the returned pointer. +// +// The memory pointed by the returned pointer is statically allocated. +// +// Example return value: "6982b86c" +SHERPA_ONNX_API const char *SherpaOnnxGetGitSha1(); + +// Please don't free the returned pointer. +// Please don't modify the memory pointed by the returned pointer. +// +// The memory pointed by the returned pointer is statically allocated. +// +// Example return value: "Fri Jun 20 11:22:52 2025" +SHERPA_ONNX_API const char *SherpaOnnxGetGitDate(); + /// Please refer to /// https://k2-fsa.github.io/sherpa/onnx/pretrained_models/index.html /// to download pre-trained models. That is, you can find encoder-xxx.onnx diff --git a/sherpa-onnx/c-api/cxx-api.cc b/sherpa-onnx/c-api/cxx-api.cc index e6278aa3..ee50fefd 100644 --- a/sherpa-onnx/c-api/cxx-api.cc +++ b/sherpa-onnx/c-api/cxx-api.cc @@ -717,4 +717,10 @@ int32_t LinearResampler::GetOutputSamplingRate() const { return SherpaOnnxLinearResamplerResampleGetOutputSampleRate(p_); } +std::string GetVersionStr() { return SherpaOnnxGetVersionStr(); } + +std::string GetGitSha1() { return SherpaOnnxGetGitSha1(); } + +std::string GetGitDate() { return SherpaOnnxGetGitDate(); } + } // namespace sherpa_onnx::cxx diff --git a/sherpa-onnx/c-api/cxx-api.h b/sherpa-onnx/c-api/cxx-api.h index 7fdf0b8e..e755040a 100644 --- a/sherpa-onnx/c-api/cxx-api.h +++ b/sherpa-onnx/c-api/cxx-api.h @@ -615,6 +615,10 @@ class SHERPA_ONNX_API LinearResampler explicit LinearResampler(const SherpaOnnxLinearResampler *p); }; +std::string GetVersionStr(); +std::string GetGitSha1(); +std::string GetGitDate(); + } // namespace sherpa_onnx::cxx #endif // SHERPA_ONNX_C_API_CXX_API_H_ diff --git a/sherpa-onnx/csrc/CMakeLists.txt b/sherpa-onnx/csrc/CMakeLists.txt index 99f7e9a2..a1e81003 100644 --- a/sherpa-onnx/csrc/CMakeLists.txt +++ b/sherpa-onnx/csrc/CMakeLists.txt @@ -129,6 +129,7 @@ set(sources utils.cc vad-model-config.cc vad-model.cc + version.cc voice-activity-detector.cc wave-reader.cc wave-writer.cc @@ -337,6 +338,7 @@ if(SHERPA_ONNX_ENABLE_BINARY) add_executable(sherpa-onnx-offline-punctuation sherpa-onnx-offline-punctuation.cc) add_executable(sherpa-onnx-offline-source-separation sherpa-onnx-offline-source-separation.cc) add_executable(sherpa-onnx-online-punctuation sherpa-onnx-online-punctuation.cc) + add_executable(sherpa-onnx-version sherpa-onnx-version.cc version.cc) add_executable(sherpa-onnx-vad sherpa-onnx-vad.cc) if(SHERPA_ONNX_ENABLE_TTS) @@ -396,6 +398,7 @@ if(SHERPA_ONNX_ENABLE_BINARY) install( TARGETS ${main_exes} + sherpa-onnx-version DESTINATION bin ) diff --git a/sherpa-onnx/csrc/sherpa-onnx-version.cc b/sherpa-onnx/csrc/sherpa-onnx-version.cc new file mode 100644 index 00000000..8c2a640b --- /dev/null +++ b/sherpa-onnx/csrc/sherpa-onnx-version.cc @@ -0,0 +1,17 @@ +// sherpa-onnx/csrc/sherpa-onnx-version.cc +// +// Copyright (c) 2025 Xiaomi Corporation + +#include + +#include + +#include "sherpa-onnx/csrc/version.h" + +int32_t main() { + printf("sherpa-onnx version : %s\n", sherpa_onnx::GetVersionStr()); + printf("sherpa-onnx Git SHA1: %s\n", sherpa_onnx::GetGitSha1()); + printf("sherpa-onnx Git date: %s\n", sherpa_onnx::GetGitDate()); + + return 0; +} diff --git a/sherpa-onnx/csrc/text-utils.cc b/sherpa-onnx/csrc/text-utils.cc index 37e84f0b..1b6c4220 100644 --- a/sherpa-onnx/csrc/text-utils.cc +++ b/sherpa-onnx/csrc/text-utils.cc @@ -312,7 +312,8 @@ static std::vector MergeCharactersIntoWords( while (i < n) { const auto &w = words[i]; if (w.size() >= 3 || (w.size() == 2 && !IsSpecial(w)) || - (w.size() == 1 && (IsPunct(w[0]) || std::isspace(static_cast(w[0]))))) { + (w.size() == 1 && + (IsPunct(w[0]) || std::isspace(static_cast(w[0]))))) { if (prev != -1) { std::string t; for (; prev < i; ++prev) { diff --git a/sherpa-onnx/csrc/version.cc b/sherpa-onnx/csrc/version.cc new file mode 100644 index 00000000..5bcd1a9a --- /dev/null +++ b/sherpa-onnx/csrc/version.cc @@ -0,0 +1,24 @@ +// sherpa-onnx/csrc/version.h +// +// Copyright 2025 Xiaomi Corporation + +#include "sherpa-onnx/csrc/version.h" + +namespace sherpa_onnx { + +const char *GetGitDate() { + static const char *date = "Fri Jun 20 11:22:52 2025"; + return date; +} + +const char *GetGitSha1() { + static const char *sha1 = "6982b86c"; + return sha1; +} + +const char *GetVersionStr() { + static const char *version = "1.12.1"; + return version; +} + +} // namespace sherpa_onnx diff --git a/sherpa-onnx/csrc/version.h b/sherpa-onnx/csrc/version.h new file mode 100644 index 00000000..c351ab5c --- /dev/null +++ b/sherpa-onnx/csrc/version.h @@ -0,0 +1,29 @@ +// sherpa-onnx/csrc/version.h +// +// Copyright 2025 Xiaomi Corporation +#ifndef SHERPA_ONNX_CSRC_VERSION_H_ +#define SHERPA_ONNX_CSRC_VERSION_H_ + +namespace sherpa_onnx { + +// Please don't free the returned pointer. +// Please don't modify the memory pointed by the returned pointer. +// +// The memory pointed by the returned pointer is statically allocated. +const char *GetVersionStr(); + +// Please don't free the returned pointer. +// Please don't modify the memory pointed by the returned pointer. +// +// The memory pointed by the returned pointer is statically allocated. +const char *GetGitSha1(); + +// Please don't free the returned pointer. +// Please don't modify the memory pointed by the returned pointer. +// +// The memory pointed by the returned pointer is statically allocated. +const char *GetGitDate(); + +} // namespace sherpa_onnx + +#endif // SHERPA_ONNX_CSRC_VERSION_H_ diff --git a/sherpa-onnx/java-api/Makefile b/sherpa-onnx/java-api/Makefile index c65548e9..6bc067e5 100644 --- a/sherpa-onnx/java-api/Makefile +++ b/sherpa-onnx/java-api/Makefile @@ -8,6 +8,7 @@ package_dir := com/k2fsa/sherpa/onnx java_files := LibraryLoader.java +java_files += VersionInfo.java java_files += WaveReader.java java_files += WaveWriter.java java_files += EndpointRule.java diff --git a/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/VersionInfo.java b/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/VersionInfo.java new file mode 100644 index 00000000..ecf0e1cd --- /dev/null +++ b/sherpa-onnx/java-api/src/com/k2fsa/sherpa/onnx/VersionInfo.java @@ -0,0 +1,23 @@ +package com.k2fsa.sherpa.onnx; + +public class VersionInfo { + + public static String getVersion() { + LibraryLoader.maybeLoad(); + return getVersionStr2(); + } + + public static String getGitSha1() { + LibraryLoader.maybeLoad(); + return getGitSha12(); + } + + public static String getGitDate() { + LibraryLoader.maybeLoad(); + return getGitDate2(); + } + + private static native String getVersionStr2(); + private static native String getGitSha12(); + private static native String getGitDate2(); +} diff --git a/sherpa-onnx/jni/CMakeLists.txt b/sherpa-onnx/jni/CMakeLists.txt index 6bbe8500..cff5ea6e 100644 --- a/sherpa-onnx/jni/CMakeLists.txt +++ b/sherpa-onnx/jni/CMakeLists.txt @@ -24,6 +24,7 @@ set(sources speaker-embedding-extractor.cc speaker-embedding-manager.cc spoken-language-identification.cc + version.cc voice-activity-detector.cc wave-reader.cc wave-writer.cc diff --git a/sherpa-onnx/jni/version.cc b/sherpa-onnx/jni/version.cc new file mode 100644 index 00000000..a24521d7 --- /dev/null +++ b/sherpa-onnx/jni/version.cc @@ -0,0 +1,49 @@ +// sherpa-onnx/jni/version.cc +// +// Copyright (c) 2025 Xiaomi Corporation +#include "sherpa-onnx/csrc/version.h" + +#include "sherpa-onnx/jni/common.h" + +namespace sherpa_onnx { + +SHERPA_ONNX_EXTERN_C +JNIEXPORT jstring JNICALL +Java_com_k2fsa_sherpa_onnx_VersionInfo_00024Companion_getVersionStr2( + JNIEnv *env, jclass /*cls*/) { + return env->NewStringUTF(GetVersionStr()); +} + +SHERPA_ONNX_EXTERN_C +JNIEXPORT jstring JNICALL +Java_com_k2fsa_sherpa_onnx_VersionInfo_00024Companion_getGitSha12( + JNIEnv *env, jclass /*cls*/) { + return env->NewStringUTF(GetGitSha1()); +} + +SHERPA_ONNX_EXTERN_C +JNIEXPORT jstring JNICALL +Java_com_k2fsa_sherpa_onnx_VersionInfo_00024Companion_getGitDate2( + JNIEnv *env, jclass /*cls*/) { + return env->NewStringUTF(GetGitDate()); +} + +SHERPA_ONNX_EXTERN_C +JNIEXPORT jstring JNICALL Java_com_k2fsa_sherpa_onnx_VersionInfo_getVersionStr2( + JNIEnv *env, jclass /*cls*/) { + return env->NewStringUTF(GetVersionStr()); +} + +SHERPA_ONNX_EXTERN_C +JNIEXPORT jstring JNICALL Java_com_k2fsa_sherpa_onnx_VersionInfo_getGitSha12( + JNIEnv *env, jclass /*cls*/) { + return env->NewStringUTF(GetGitSha1()); +} + +SHERPA_ONNX_EXTERN_C +JNIEXPORT jstring JNICALL Java_com_k2fsa_sherpa_onnx_VersionInfo_getGitDate2( + JNIEnv *env, jclass /*cls*/) { + return env->NewStringUTF(GetGitDate()); +} + +} // namespace sherpa_onnx diff --git a/sherpa-onnx/kotlin-api/VersionInfo.kt b/sherpa-onnx/kotlin-api/VersionInfo.kt new file mode 100644 index 00000000..f80b118f --- /dev/null +++ b/sherpa-onnx/kotlin-api/VersionInfo.kt @@ -0,0 +1,22 @@ +package com.k2fsa.sherpa.onnx + +class VersionInfo { + companion object { + init { + System.loadLibrary("sherpa-onnx-jni") + } + + val version: String + get() = getVersionStr2() + + val gitSha1: String + get() = getGitSha12() + + val gitDate: String + get() = getGitDate2() + + external fun getVersionStr2(): String + external fun getGitSha12(): String + external fun getGitDate2(): String + } +} diff --git a/sherpa-onnx/pascal-api/sherpa_onnx.pas b/sherpa-onnx/pascal-api/sherpa_onnx.pas index 652ea539..d50a3cb8 100644 --- a/sherpa-onnx/pascal-api/sherpa_onnx.pas +++ b/sherpa-onnx/pascal-api/sherpa_onnx.pas @@ -578,6 +578,10 @@ type function SherpaOnnxWriteWave(Filename: AnsiString; Samples: array of Single; SampleRate: Integer): Boolean; + function SherpaOnnxGetVersionStr(): AnsiString; + function SherpaOnnxGetGitSha1(): AnsiString; + function SherpaOnnxGetGitDate(): AnsiString; + implementation uses @@ -951,6 +955,30 @@ function SherpaOnnxCreateLinearResampler(SampleRateInHz: cint32; NumZeros: cint32): Pointer; cdecl; external SherpaOnnxLibName; +function SherpaOnnxGetVersionStrWrapper(): PAnsiChar; cdecl; + external SherpaOnnxLibName name 'SherpaOnnxGetVersionStr'; + +function SherpaOnnxGetGitSha1Wrapper(): PAnsiChar; cdecl; + external SherpaOnnxLibName name 'SherpaOnnxGetGitSha1'; + +function SherpaOnnxGetGitDateWrapper(): PAnsiChar; cdecl; + external SherpaOnnxLibName name 'SherpaOnnxGetGitDate'; + +function SherpaOnnxGetVersionStr(): AnsiString; +begin + Result := SherpaOnnxGetVersionStrWrapper(); +end; + +function SherpaOnnxGetGitSha1(): AnsiString; +begin + Result := SherpaOnnxGetGitSha1Wrapper(); +end; + +function SherpaOnnxGetGitDate(): AnsiString; +begin + Result := SherpaOnnxGetGitDateWrapper(); +end; + procedure SherpaOnnxDestroyLinearResampler(P: Pointer); cdecl; external SherpaOnnxLibName; diff --git a/sherpa-onnx/python/csrc/CMakeLists.txt b/sherpa-onnx/python/csrc/CMakeLists.txt index e3df5028..7d6cabb3 100644 --- a/sherpa-onnx/python/csrc/CMakeLists.txt +++ b/sherpa-onnx/python/csrc/CMakeLists.txt @@ -53,6 +53,7 @@ set(srcs tensorrt-config.cc vad-model-config.cc vad-model.cc + version.cc voice-activity-detector.cc wave-writer.cc ) diff --git a/sherpa-onnx/python/csrc/offline-source-separation.cc b/sherpa-onnx/python/csrc/offline-source-separation.cc index f4040377..6b6dde4b 100644 --- a/sherpa-onnx/python/csrc/offline-source-separation.cc +++ b/sherpa-onnx/python/csrc/offline-source-separation.cc @@ -4,6 +4,7 @@ #include "sherpa-onnx/csrc/offline-source-separation.h" +#include #include #include "sherpa-onnx/python/csrc/offline-source-separation-model-config.h" diff --git a/sherpa-onnx/python/csrc/offline-source-separation.h b/sherpa-onnx/python/csrc/offline-source-separation.h index 90c9fdcc..b36c2adb 100644 --- a/sherpa-onnx/python/csrc/offline-source-separation.h +++ b/sherpa-onnx/python/csrc/offline-source-separation.h @@ -1,9 +1,9 @@ -// sherpa-onnx/python/csrc/offline-source-separation-config.h +// sherpa-onnx/python/csrc/offline-source-separation.h // // Copyright (c) 2025 Xiaomi Corporation -#ifndef SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_CONFIG_H_ -#define SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_CONFIG_H_ +#ifndef SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_H_ +#define SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_H_ #include "sherpa-onnx/python/csrc/sherpa-onnx.h" @@ -13,4 +13,4 @@ void PybindOfflineSourceSeparation(py::module *m); } -#endif // SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_CONFIG_H_ +#endif // SHERPA_ONNX_PYTHON_CSRC_OFFLINE_SOURCE_SEPARATION_H_ diff --git a/sherpa-onnx/python/csrc/sherpa-onnx.cc b/sherpa-onnx/python/csrc/sherpa-onnx.cc index 4636eea2..c03f6792 100644 --- a/sherpa-onnx/python/csrc/sherpa-onnx.cc +++ b/sherpa-onnx/python/csrc/sherpa-onnx.cc @@ -31,6 +31,7 @@ #include "sherpa-onnx/python/csrc/spoken-language-identification.h" #include "sherpa-onnx/python/csrc/vad-model-config.h" #include "sherpa-onnx/python/csrc/vad-model.h" +#include "sherpa-onnx/python/csrc/version.h" #include "sherpa-onnx/python/csrc/voice-activity-detector.h" #include "sherpa-onnx/python/csrc/wave-writer.h" @@ -112,6 +113,7 @@ PYBIND11_MODULE(_sherpa_onnx, m) { PybindAlsa(&m); PybindOfflineSpeechDenoiser(&m); PybindOfflineSourceSeparation(&m); + PybindVersion(&m); } } // namespace sherpa_onnx diff --git a/sherpa-onnx/python/csrc/version.cc b/sherpa-onnx/python/csrc/version.cc new file mode 100644 index 00000000..b48c1d4a --- /dev/null +++ b/sherpa-onnx/python/csrc/version.cc @@ -0,0 +1,21 @@ +// sherpa-onnx/python/csrc/version.cc +// +// Copyright (c) 2025 Xiaomi Corporation + +#include "sherpa-onnx/python/csrc/version.h" + +#include + +#include "sherpa-onnx/csrc/version.h" + +namespace sherpa_onnx { + +void PybindVersion(py::module *m) { + m->attr("version") = std::string(GetVersionStr()); + + m->attr("git_sha1") = std::string(GetGitSha1()); + + m->attr("git_date") = std::string(GetGitDate()); +} + +} // namespace sherpa_onnx diff --git a/sherpa-onnx/python/csrc/version.h b/sherpa-onnx/python/csrc/version.h new file mode 100644 index 00000000..6e00b111 --- /dev/null +++ b/sherpa-onnx/python/csrc/version.h @@ -0,0 +1,16 @@ +// sherpa-onnx/python/csrc/version.h +// +// Copyright (c) 2025 Xiaomi Corporation + +#ifndef SHERPA_ONNX_PYTHON_CSRC_VERSION_H_ +#define SHERPA_ONNX_PYTHON_CSRC_VERSION_H_ + +#include "sherpa-onnx/python/csrc/sherpa-onnx.h" + +namespace sherpa_onnx { + +void PybindVersion(py::module *m); + +} + +#endif // SHERPA_ONNX_PYTHON_CSRC_VERSION_H_ diff --git a/sherpa-onnx/python/sherpa_onnx/__init__.py b/sherpa-onnx/python/sherpa_onnx/__init__.py index 9bb82750..705c2ad0 100644 --- a/sherpa-onnx/python/sherpa_onnx/__init__.py +++ b/sherpa-onnx/python/sherpa_onnx/__init__.py @@ -49,6 +49,9 @@ from _sherpa_onnx import ( VadModel, VadModelConfig, VoiceActivityDetector, + git_date, + git_sha1, + version, write_wave, ) diff --git a/swift-api-examples/SherpaOnnx.swift b/swift-api-examples/SherpaOnnx.swift index 148876a8..4c01975e 100644 --- a/swift-api-examples/SherpaOnnx.swift +++ b/swift-api-examples/SherpaOnnx.swift @@ -1448,3 +1448,15 @@ class SherpaOnnxOfflineSpeechDenoiserWrapper { return Int(SherpaOnnxOfflineSpeechDenoiserGetSampleRate(impl)) } } + +func getSherpaOnnxVersion() -> String { + return String(cString: SherpaOnnxGetVersionStr()) +} + +func getSherpaOnnxGitSha1() -> String { + return String(cString: SherpaOnnxGetGitSha1()) +} + +func getSherpaOnnxGitDate() -> String { + return String(cString: SherpaOnnxGetGitDate()) +} diff --git a/swift-api-examples/run-test-version.sh b/swift-api-examples/run-test-version.sh new file mode 100755 index 00000000..8736de0d --- /dev/null +++ b/swift-api-examples/run-test-version.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -ex + +if [ ! -d ../build-swift-macos ]; then + echo "Please run ../build-swift-macos.sh first!" + exit 1 +fi + +if [ ! -e ./test-version ]; then + # Note: We use -lc++ to link against libc++ instead of libstdc++ + swiftc \ + -lc++ \ + -I ../build-swift-macos/install/include \ + -import-objc-header ./SherpaOnnx-Bridging-Header.h \ + ./test-version.swift ./SherpaOnnx.swift \ + -L ../build-swift-macos/install/lib/ \ + -l sherpa-onnx \ + -l onnxruntime \ + -o ./test-version + + strip ./test-version +else + echo "./test-version exists - skip building" +fi + +export DYLD_LIBRARY_PATH=$PWD/../build-swift-macos/install/lib:$DYLD_LIBRARY_PATH +./test-version diff --git a/swift-api-examples/test-version.swift b/swift-api-examples/test-version.swift new file mode 100644 index 00000000..c516a430 --- /dev/null +++ b/swift-api-examples/test-version.swift @@ -0,0 +1,15 @@ +func run() { + let version = getSherpaOnnxVersion() + let gitSha1 = getSherpaOnnxGitSha1() + let gitDate = getSherpaOnnxGitDate() + print("sherpa-onnx version: \(version)") + print("sherpa-onnx gitSha1: \(gitSha1)") + print("sherpa-onnx gitDate: \(gitDate)") +} + +@main +struct App { + static func main() { + run() + } +} diff --git a/wasm/nodejs/CMakeLists.txt b/wasm/nodejs/CMakeLists.txt index 999c5f67..2167882f 100644 --- a/wasm/nodejs/CMakeLists.txt +++ b/wasm/nodejs/CMakeLists.txt @@ -94,6 +94,10 @@ set(exported_functions SherpaOnnxDestroyOfflineSpeechDenoiser SherpaOnnxOfflineSpeechDenoiserGetSampleRate SherpaOnnxOfflineSpeechDenoiserRun + # version + SherpaOnnxGetGitDate + SherpaOnnxGetGitSha1 + SherpaOnnxGetVersionStr )