Build MFC examples for Windows x86 (Win32) (#434)
Also, strip binaries on Linux before uploading.
This commit is contained in:
21
.github/workflows/aarch64-linux-gnu-shared.yaml
vendored
21
.github/workflows/aarch64-linux-gnu-shared.yaml
vendored
@@ -24,15 +24,6 @@ on:
|
||||
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release:
|
||||
description: "Whether to release"
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
RELEASE:
|
||||
|- # Release if there is a release tag name or a release flag in workflow_dispatch
|
||||
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}
|
||||
|
||||
concurrency:
|
||||
group: aarch64-linux-gnu-shared-${{ github.ref }}
|
||||
@@ -150,6 +141,9 @@ jobs:
|
||||
- name: Copy files
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
|
||||
aarch64-none-linux-gnu-strip --version
|
||||
|
||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-shared
|
||||
@@ -158,6 +152,13 @@ jobs:
|
||||
cp -a build-aarch64-linux-gnu/install/bin $dst/
|
||||
cp -a build-aarch64-linux-gnu/install/lib $dst/
|
||||
|
||||
ls -lh build-aarch64-linux-gnu/install/lib
|
||||
ls -lh build-aarch64-linux-gnu/install/bin
|
||||
|
||||
ls -lh $dst/bin/
|
||||
echo "strip"
|
||||
aarch64-none-linux-gnu-strip $dst/bin/*
|
||||
|
||||
tree $dst
|
||||
|
||||
tar cjvf ${dst}.tar.bz2 $dst
|
||||
@@ -168,7 +169,7 @@ jobs:
|
||||
path: sherpa-onnx-*linux-aarch64-shared.tar.bz2
|
||||
|
||||
- name: Release pre-compiled binaries and libs for aarch64 linux
|
||||
if: env.RELEASE == 'true'
|
||||
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:
|
||||
file_glob: true
|
||||
|
||||
21
.github/workflows/aarch64-linux-gnu-static.yaml
vendored
21
.github/workflows/aarch64-linux-gnu-static.yaml
vendored
@@ -24,15 +24,6 @@ on:
|
||||
- 'toolchains/aarch64-linux-gnu.toolchain.cmake'
|
||||
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release:
|
||||
description: "Whether to release"
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
RELEASE:
|
||||
|- # Release if there is a release tag name or a release flag in workflow_dispatch
|
||||
${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }}
|
||||
|
||||
concurrency:
|
||||
group: aarch64-linux-gnu-static-${{ github.ref }}
|
||||
@@ -151,13 +142,21 @@ jobs:
|
||||
- name: Copy files
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
|
||||
aarch64-none-linux-gnu-strip --version
|
||||
|
||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-aarch64-static
|
||||
mkdir $dst
|
||||
|
||||
ls -lh build-aarch64-linux-gnu/install/lib
|
||||
|
||||
cp -a build-aarch64-linux-gnu/install/bin $dst/
|
||||
cp -a build-aarch64-linux-gnu/install/lib $dst/
|
||||
ls -lh $dst/bin/
|
||||
echo "strip"
|
||||
aarch64-none-linux-gnu-strip $dst/bin/*
|
||||
ls -lh $dst/bin/
|
||||
|
||||
tree $dst
|
||||
|
||||
@@ -169,7 +168,7 @@ jobs:
|
||||
path: sherpa-onnx-*linux-aarch64-static.tar.bz2
|
||||
|
||||
- name: Release pre-compiled binaries and libs for aarch64 linux
|
||||
if: env.RELEASE == 'true'
|
||||
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:
|
||||
file_glob: true
|
||||
|
||||
14
.github/workflows/arm-linux-gnueabihf.yaml
vendored
14
.github/workflows/arm-linux-gnueabihf.yaml
vendored
@@ -150,13 +150,25 @@ jobs:
|
||||
- name: Copy files
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH
|
||||
arm-none-linux-gnueabihf-strip --version
|
||||
|
||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
|
||||
dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-arm-gnueabihf-${{ matrix.lib_type }}
|
||||
mkdir $dst
|
||||
|
||||
ls -lh build-arm-linux-gnueabihf/install/lib
|
||||
|
||||
cp -a build-arm-linux-gnueabihf/install/bin $dst/
|
||||
cp -a build-arm-linux-gnueabihf/install/lib $dst/
|
||||
ls -lh $dst/bin/*
|
||||
arm-none-linux-gnueabihf-strip $dst/bin/*
|
||||
ls -lh $dst
|
||||
|
||||
lib_type=${{ matrix.lib_type }}
|
||||
if [[ $lib_type == "shared" ]]; then
|
||||
cp -a build-arm-linux-gnueabihf/install/lib $dst/
|
||||
fi
|
||||
|
||||
tree $dst
|
||||
|
||||
|
||||
17
.github/workflows/linux.yaml
vendored
17
.github/workflows/linux.yaml
vendored
@@ -88,9 +88,25 @@ jobs:
|
||||
- name: Display dependencies of sherpa-onnx for linux
|
||||
shell: bash
|
||||
run: |
|
||||
ls -lh build/bin
|
||||
ls -lh build/_deps/onnxruntime-src/lib/
|
||||
|
||||
echo "strip"
|
||||
strip build/bin/*
|
||||
echo "after strip"
|
||||
ls -lh build/bin
|
||||
|
||||
file build/bin/sherpa-onnx
|
||||
file build/bin/sherpa-onnx
|
||||
ls -lh build/bin/sherpa-onnx
|
||||
readelf -d build/bin/sherpa-onnx
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: matrix.shared_lib == 'OFF' && matrix.build_type == 'Release'
|
||||
with:
|
||||
name: release-static
|
||||
path: build/bin/*
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -186,3 +202,4 @@ jobs:
|
||||
with:
|
||||
name: tts-generated-test-files
|
||||
path: tts
|
||||
|
||||
|
||||
29
.github/workflows/mfc.yaml
vendored
29
.github/workflows/mfc.yaml
vendored
@@ -36,8 +36,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
# arch: [x64, Win32]
|
||||
arch: [x64]
|
||||
arch: [x64, x86]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -55,7 +54,11 @@ jobs:
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -A ${{ matrix.arch }} -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=./install ..
|
||||
arch=${{ matrix.arch }}
|
||||
if [[ $arch == "x86" ]]; then
|
||||
arch=Win32
|
||||
fi
|
||||
cmake -A $arch -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=./install ..
|
||||
|
||||
- name: Build sherpa-onnx for windows
|
||||
shell: bash
|
||||
@@ -83,32 +86,40 @@ jobs:
|
||||
run: |
|
||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
arch=${{ matrix.arch }}
|
||||
if [[ $arch == "x86" ]]; then
|
||||
src=mfc-examples/Release
|
||||
ls -h $src
|
||||
dst=mfc-examples/$arch/Release
|
||||
|
||||
mkdir -p $dst
|
||||
cp $src/* $dst
|
||||
fi
|
||||
|
||||
cd mfc-examples/$arch/Release
|
||||
ls -lh
|
||||
|
||||
cp -v StreamingSpeechRecognition.exe sherpa-onnx-streaming-${SHERPA_ONNX_VERSION}.exe
|
||||
cp -v NonStreamingSpeechRecognition.exe sherpa-onnx-non-streaming-${SHERPA_ONNX_VERSION}.exe
|
||||
cp -v NonStreamingTextToSpeech.exe ../sherpa-onnx-non-streaming-tts-${SHERPA_ONNX_VERSION}.exe
|
||||
cp -v StreamingSpeechRecognition.exe sherpa-onnx-streaming-asr-$arch-${SHERPA_ONNX_VERSION}.exe
|
||||
cp -v NonStreamingSpeechRecognition.exe sherpa-onnx-non-streaming-asr-$arch-${SHERPA_ONNX_VERSION}.exe
|
||||
cp -v NonStreamingTextToSpeech.exe ../sherpa-onnx-non-streaming-tts-$arch-${SHERPA_ONNX_VERSION}.exe
|
||||
ls -lh
|
||||
|
||||
- name: Upload artifact tts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: non-streaming-tts-${{ matrix.arch }}
|
||||
path: ./mfc-examples/${{ matrix.arch }}/Release/NonStreamingTextToSpeech.exe
|
||||
path: ./mfc-examples/${{ matrix.arch }}/sherpa-onnx-non-streaming-tts-*.exe
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: streaming-speech-recognition-${{ matrix.arch }}
|
||||
path: ./mfc-examples/${{ matrix.arch }}/Release/StreamingSpeechRecognition.exe
|
||||
path: ./mfc-examples/${{ matrix.arch }}/Release/sherpa-onnx-streaming-asr-*.exe
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: non-streaming-speech-recognition-${{ matrix.arch }}
|
||||
path: ./mfc-examples/${{ matrix.arch }}/Release/NonStreamingSpeechRecognition.exe
|
||||
path: ./mfc-examples/${{ matrix.arch }}/Release/sherpa-onnx-non-streaming-asr-*.exe
|
||||
|
||||
- name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }}
|
||||
if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
||||
|
||||
Reference in New Issue
Block a user