Provide prebuilt .jar files for different java versions. (#1307)
This commit is contained in:
35
.github/workflows/linux-jni.yaml
vendored
35
.github/workflows/linux-jni.yaml
vendored
@@ -20,12 +20,18 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
|
java-version: ['8', '11', '16', '17', '21']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
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
|
- name: Display PWD
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -33,7 +39,8 @@ jobs:
|
|||||||
ls -lh
|
ls -lh
|
||||||
du -h -d1 .
|
du -h -d1 .
|
||||||
|
|
||||||
- name: Build jar
|
- name: Build jar ${{ matrix.java-version }}
|
||||||
|
if: matrix.java-version == '21'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||||
@@ -44,9 +51,20 @@ jobs:
|
|||||||
cd ../..
|
cd ../..
|
||||||
ls -lh *.jar
|
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
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: release-jni-linux-jar
|
name: release-jni-linux-jar-${{ matrix.java-version }}
|
||||||
path: ./*.jar
|
path: ./*.jar
|
||||||
|
|
||||||
- name: Release jar
|
- name: Release jar
|
||||||
@@ -56,8 +74,12 @@ jobs:
|
|||||||
file_glob: true
|
file_glob: true
|
||||||
overwrite: true
|
overwrite: true
|
||||||
file: ./*.jar
|
file: ./*.jar
|
||||||
|
# repo_name: k2-fsa/sherpa-onnx
|
||||||
|
# repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
|
||||||
|
# tag: v1.10.23
|
||||||
|
|
||||||
- name: Build sherpa-onnx
|
- name: Build sherpa-onnx
|
||||||
|
if: matrix.java-version == '21'
|
||||||
uses: addnab/docker-run-action@v3
|
uses: addnab/docker-run-action@v3
|
||||||
with:
|
with:
|
||||||
image: quay.io/pypa/manylinux2014_x86_64
|
image: quay.io/pypa/manylinux2014_x86_64
|
||||||
@@ -122,6 +144,7 @@ jobs:
|
|||||||
ls -lh install/bin
|
ls -lh install/bin
|
||||||
|
|
||||||
- name: Display dependencies of sherpa-onnx for linux
|
- name: Display dependencies of sherpa-onnx for linux
|
||||||
|
if: matrix.java-version == '21'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
du -h -d1 .
|
du -h -d1 .
|
||||||
@@ -140,11 +163,13 @@ jobs:
|
|||||||
readelf -d build/bin/sherpa-onnx
|
readelf -d build/bin/sherpa-onnx
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: matrix.java-version == '21'
|
||||||
with:
|
with:
|
||||||
name: release-jni-linux
|
name: release-jni-linux-${{ matrix.java-version }}
|
||||||
path: build/install/*
|
path: build/install/*
|
||||||
|
|
||||||
- name: Copy files
|
- name: Copy files
|
||||||
|
if: matrix.java-version == '21'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
du -h -d1 .
|
du -h -d1 .
|
||||||
@@ -163,7 +188,7 @@ jobs:
|
|||||||
du -h -d1 .
|
du -h -d1 .
|
||||||
|
|
||||||
- name: Publish to huggingface
|
- 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:
|
env:
|
||||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||||
uses: nick-fields/retry@v3
|
uses: nick-fields/retry@v3
|
||||||
@@ -195,7 +220,7 @@ jobs:
|
|||||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
|
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
|
||||||
|
|
||||||
- name: Release pre-compiled binaries and libs for linux x64
|
- 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
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
file_glob: true
|
file_glob: true
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
./run-vad-asr.sh
|
./run-vad-asr.sh
|
||||||
|
|
||||||
- name: Release jar
|
- name: Release
|
||||||
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/')
|
||||||
uses: svenstaro/upload-release-action@v2
|
uses: svenstaro/upload-release-action@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user