forked from k2-fsa/sherpa-onnx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide prebuilt .jar files for different java versions. (k2-fsa#1307)
- Loading branch information
1 parent
3687c9f
commit d60a4d4
Showing
2 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,20 +20,27 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
java-version: ['8', '11', '16', '17', '21'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' # See 'Supported distributions' for available options | ||
java-version: ${{ matrix.java-version }} | ||
|
||
- name: Display PWD | ||
shell: bash | ||
run: | | ||
echo "pwd: $PWD" | ||
ls -lh | ||
du -h -d1 . | ||
- name: Build jar | ||
- name: Build jar ${{ matrix.java-version }} | ||
if: matrix.java-version == '21' | ||
shell: bash | ||
run: | | ||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
|
@@ -44,9 +51,20 @@ jobs: | |
cd ../.. | ||
ls -lh *.jar | ||
- name: Build jar ${{ matrix.java-version }} | ||
shell: bash | ||
run: | | ||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
cd sherpa-onnx/java-api | ||
make | ||
ls -lh build/ | ||
cp build/sherpa-onnx.jar ../../sherpa-onnx-$SHERPA_ONNX_VERSION-java${{ matrix.java-version }}.jar | ||
cd ../.. | ||
ls -lh *.jar | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-jni-linux-jar | ||
name: release-jni-linux-jar-${{ matrix.java-version }} | ||
path: ./*.jar | ||
|
||
- name: Release jar | ||
|
@@ -56,8 +74,12 @@ jobs: | |
file_glob: true | ||
overwrite: true | ||
file: ./*.jar | ||
# repo_name: k2-fsa/sherpa-onnx | ||
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
# tag: v1.10.23 | ||
|
||
- name: Build sherpa-onnx | ||
if: matrix.java-version == '21' | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: quay.io/pypa/manylinux2014_x86_64 | ||
|
@@ -122,6 +144,7 @@ jobs: | |
ls -lh install/bin | ||
- name: Display dependencies of sherpa-onnx for linux | ||
if: matrix.java-version == '21' | ||
shell: bash | ||
run: | | ||
du -h -d1 . | ||
|
@@ -140,11 +163,13 @@ jobs: | |
readelf -d build/bin/sherpa-onnx | ||
- uses: actions/upload-artifact@v4 | ||
if: matrix.java-version == '21' | ||
with: | ||
name: release-jni-linux | ||
name: release-jni-linux-${{ matrix.java-version }} | ||
path: build/install/* | ||
|
||
- name: Copy files | ||
if: matrix.java-version == '21' | ||
shell: bash | ||
run: | | ||
du -h -d1 . | ||
|
@@ -163,7 +188,7 @@ jobs: | |
du -h -d1 . | ||
- name: Publish to huggingface | ||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') | ||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && matrix.java-version == '21' | ||
env: | ||
HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
uses: nick-fields/retry@v3 | ||
|
@@ -195,7 +220,7 @@ jobs: | |
git push https://csukuangfj:[email protected]/csukuangfj/sherpa-onnx-libs main | ||
- name: Release pre-compiled binaries and libs for linux x64 | ||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.java-version == '21' | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
file_glob: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters