diff --git a/.github/scripts/test-dot-net.sh b/.github/scripts/test-dot-net.sh
index 6c3305ddbf..adc858529c 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 14b527be64..b7c13c730f 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 159138c321..c9d3353565 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 a8da8ce7f3..3526912d02 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 eaf106664b..6af64a03a9 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 35505c91ed..e21fdc362b 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 eb01120fed..bae70b3894 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 7cb4253f6d..e7c8f627fb 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 e49b179c8b..b6fd9630f8 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 bfe9f9ac7c..7bd01c11ec 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 bd8cd7e077..d72929828f 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 43cdef49e0..951d05e591 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 90bcc7323a..9ba71b9f66 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 c88718d6e0..9f2a735592 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 cc7525cd42..363531d818 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 b8614cb76c..43152a4597 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 1609739c69..b392e6c866 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 7b96b28475..11f89f2745 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 bf103111b1..3a8aea9f7e 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 f1a4364fc0..6e9c8a2842 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 d1d394c9f7..b7cd2af9f6 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 0260c35156..ae69ed1ed4 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 24f1c219ee..2d0c57840b 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 71edea7491..9127f9dfc2 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 a9035462d6..a5d62586ff 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 58a7cc8973..5f8612836b 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 bd32218571..7675f1ce4d 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 a360a35530..f4e76fe99b 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 77501043f3..ad5e9f7233 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 68998f7782..8a8f059e5f 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 9894fd1c4f..f83f6a0870 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 732a17d7b5..b991e831db 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 612f25e8c0..b3e29bbdcc 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 88358921b2..5f2c34b832 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 8fcfafd43d..f38d4216d3 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 5d9bc11db0..0badb830c2 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 a3e81279b0..e53e7b67ce 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 3295fc647d..beac7c0078 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 d3441c813f..f8d7b68810 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 06f10c27b0..7537c6023f 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 c2b1d01db1..9dcbd506ce 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 f1fdd5ec71..82b30a6fcd 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 e85ff1644f..f8f4abb368 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 59f6a6af92..1d02b59b87 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 9e64a9ab16..d051138615 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 7b5b2e5141..15c0396815 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 e1a2ae1a2e..d493dfb9bb 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 3bce5cdcd6..e8eaea904a 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 d28b7cba45..17bfbfc1ab 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 72b0047ea5..220c8b66e4 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 1877b2a6d7..8c5a7f797c 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 b4ce561157..be4ea38bb3 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 ff796e21ed..dafd7cc868 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 a59c1c3823..793c2ecfce 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 ca7f0767dd..cc3d4e1f45 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 e8ba663f4c..3f7fd78be2 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 aa2f03effa..0ebb657443 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 b7ccda0524..d204bb53e7 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 5d8a7cac2e..c873c95b7f 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 d72e760c39..2be4902c5b 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 3308c7c578..9a63108e6c 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 2cf6304e65..4623be6915 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 333ed3e9ef..8655c5af55 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 f997381ceb..85dc95a8c0 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 05c67591e1..3a14d5e21e 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 9fd9f17a31..b72c894fb9 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 807fa8ca8f..d45dbe3baf 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 68459af098..2e40d77611 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 ef56e9334e..a54154a059 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 b10cf2516b..c1b38fe339 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 7f21f98c2e..56f1bd9c8d 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 422212cfaf..d9cce8e69d 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 3f3cbba212..73ec5e859e 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 afcdee0217..ed455a2c06 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 9cea32bdcb..66c59888e3 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 7cda968990..19f97f5b80 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 ab2a4f0904..6153dca6de 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 35bb7ab36d..55d13bd82a 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 ce18a3c53f..e9d5efbc5e 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 4721f4a770..352bcb223e 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 3f667bea25..a15560c725 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 b89781be56..c59099ea2d 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 9b46b64d97..214247672c 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 7eaa7debac..bf96d85e08 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 d6bff9b168..afae7675a8 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 539025c8c5..677835eca3 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 232f8fe27c..540bcd32c0 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 0a21630dea..c5c47b7f12 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 34507164b4..d2b41464a6 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 92f32b3475..ceaad03d4c 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 e2f7075a83..2de666ff05 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 2879c42bc9..9fef787c30 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 744095411d..eee2619e1d 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 d3e931fff6..93b7fb5900 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 f5afa584a4..be55455cf8 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 76013291b7..cf26537896 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 b6f3eb036c..64ec4642f1 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 d67ae88181..b639706ace 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 81052cac84..a7d7b5118a 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 14301f9f06..67b6682de1 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 3de86fa91b..eb55c475a8 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 8daa312122..f446b68ec8 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 02a328a9bd..a0b97eb9b9 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 1a72be6ab4..4c5ebe8454 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 8b7c2029f7..ea0205fde0 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 b6ab5bf7e9..8ab23998da 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 0d15af946b..0a4f148457 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 7abf022853..c3039a65ce 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 85d3ad7f67..d20fb223ae 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 1ab84c82d1..9757648c62 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 59d9ef3707..5c923c960d 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 2dedc05ea1..d2e6e48cbc 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 0000000000..d384e0da94
--- /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 457b847dd6..1810ddbd8e 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/dotnet-examples/sherpa-onnx.sln b/dotnet-examples/sherpa-onnx.sln
index 0c8e24abe1..65706b87b6 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 0000000000..732fc87794
--- /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 0000000000..3e9f255b06
--- /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 0000000000..b49cd89623
--- /dev/null
+++ b/dotnet-examples/version-test/version-test.csproj
@@ -0,0 +1,15 @@
+
+
+
+ Exe
+ net8.0
+ version_test
+ enable
+ enable
+
+
+
+
+
+
+
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 298f9d38f0..4b62ca1c68 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 d9f5dae5cc..5a2766d9f6 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 0000000000..ab9ce5229f
--- /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 0000000000..7ea54ffc04
--- /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 0000000000..80e040b731
--- /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 0000000000..97fb3ac51c
--- /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 6fde6f2d31..1cc4e64fbf 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 0000000000..baf3eb83fa
--- /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 6207e518ff..618addee60 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 7c7c3ca71e..411bb45559 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 c4b08427a4..a685f50de5 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/scripts/dotnet/VersionInfo.cs b/scripts/dotnet/VersionInfo.cs
new file mode 100644
index 0000000000..02248d7434
--- /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/node-addon-api/CMakeLists.txt b/scripts/node-addon-api/CMakeLists.txt
index cf391cfaa1..135116d67d 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 840ead7103..3fdd637f39 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 0ad3afe003..d718aea839 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 0000000000..1b25717d94
--- /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 cbc8816624..7192b1e3e5 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 d442ce3817..bf832c5909 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;
};
diff --git a/sherpa-onnx/c-api/c-api.h b/sherpa-onnx/c-api/c-api.h
index 920d0e9b51..02df437210 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 e6278aa3a6..ee50fefdd4 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 7fdf0b8e03..e755040a24 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 99f7e9a260..9e9dc97bd6 100644
--- a/sherpa-onnx/csrc/CMakeLists.txt
+++ b/sherpa-onnx/csrc/CMakeLists.txt
@@ -197,6 +197,7 @@ if(SHERPA_ONNX_ENABLE_TTS)
offline-tts-vits-model.cc
offline-tts.cc
piper-phonemize-lexicon.cc
+ version.cc
vocoder.cc
vocos-vocoder.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 0000000000..8c2a640b9c
--- /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/version.cc b/sherpa-onnx/csrc/version.cc
new file mode 100644
index 0000000000..5bcd1a9a63
--- /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 0000000000..c351ab5c3b
--- /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 c65548e9e2..6bc067e5cc 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 0000000000..ecf0e1cd25
--- /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 6bbe85004b..cff5ea6edf 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 0000000000..a24521d71c
--- /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 0000000000..f80b118fb3
--- /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/python/csrc/CMakeLists.txt b/sherpa-onnx/python/csrc/CMakeLists.txt
index e3df5028e4..7d6cabb358 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/sherpa-onnx.cc b/sherpa-onnx/python/csrc/sherpa-onnx.cc
index 4636eea216..c03f67925d 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 0000000000..1e7b3ab0c6
--- /dev/null
+++ b/sherpa-onnx/python/csrc/version.cc
@@ -0,0 +1,19 @@
+// sherpa-onnx/python/csrc/version.cc
+//
+// Copyright (c) 2025 Xiaomi Corporation
+
+#include "sherpa-onnx/python/csrc/version.h"
+
+#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 0000000000..6e00b11137
--- /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 9bb827503c..705c2ad02e 100644
--- a/sherpa-onnx/python/sherpa_onnx/__init__.py
+++ b/sherpa-onnx/python/sherpa_onnx/__init__.py
@@ -49,6 +49,9 @@
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 148876a839..4c01975e76 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 0000000000..8736de0dde
--- /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 0000000000..c516a430f1
--- /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 999c5f6783..2167882f6d 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
)