Fangjun Kuang
Committed by GitHub

Provide prebuilt .jar files for different java versions. (#1307)

... ... @@ -20,12 +20,18 @@ 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: |
... ... @@ -33,7 +39,8 @@ jobs:
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:$HF_TOKEN@huggingface.co/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
... ...
... ... @@ -78,7 +78,7 @@ jobs:
run: |
./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/')
uses: svenstaro/upload-release-action@v2
with:
... ...