@@ -14,12 +14,13 @@ concurrency:
1414 cancel-in-progress : true
1515
1616jobs :
17- sherpa_onnx_linux :
18- # if: false
19- permissions :
20- id-token : write # Required for authentication using OIDC
21- name : sherpa_onnx_linux
22- runs-on : ubuntu-latest
17+ build_linux_libs_x64 :
18+ name : ${{ matrix.os }}
19+ runs-on : ${{ matrix.os }}
20+ strategy :
21+ fail-fast : false
22+ matrix :
23+ os : [ubuntu-latest]
2324
2425 steps :
2526 - uses : actions/checkout@v4
@@ -30,37 +31,76 @@ jobs:
3031 ./new-release.sh
3132 git diff .
3233
33- - name : Fix version
34- shell : bash
35- run : |
36- SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
34+ - name : Build sherpa-onnx
35+ uses : addnab/docker-run-action@v3
36+ with :
37+ image : quay.io/pypa/manylinux2014_x86_64
38+ options : |
39+ --volume ${{ github.workspace }}/:/home/runner/work/sherpa-onnx/sherpa-onnx
40+ shell : bash
41+ run : |
42+ uname -a
43+ gcc --version
44+ cmake --version
45+ cat /etc/*release
46+ id
47+ pwd
3748
38- src_dir=$PWD/flutter/sherpa_onnx_linux
39- pushd $src_dir
40- v="version: $SHERPA_ONNX_VERSION"
41- echo "v: $v"
42- sed -i.bak s"/^version: .*/$v/" ./pubspec.yaml
43- rm *.bak
44- git status
45- git diff
49+ cd /home/runner/work/sherpa-onnx/sherpa-onnx
4650
47- - name : Copy extra files
51+ mkdir build
52+ cd build
53+
54+ cmake \
55+ -D SHERPA_ONNX_ENABLE_PORTAUDIO=OFF \
56+ -D SHERPA_ONNX_ENABLE_TTS=ON \
57+ -D CMAKE_BUILD_TYPE=Release \
58+ -D BUILD_SHARED_LIBS=ON \
59+ -D CMAKE_INSTALL_PREFIX=./install \
60+ -D SHERPA_ONNX_ENABLE_JNI=OFF \
61+ -D SHERPA_ONNX_ENABLE_BINARY=OFF \
62+ ..
63+
64+ make -j2
65+ make install
66+
67+ ls -lh ./install/lib
68+
69+ - name : Create tar file
4870 shell : bash
4971 run : |
50- dst=flutter/sherpa_onnx_linux
72+ mkdir x64
73+ dst=x64
74+ cp -v build/install/lib/lib* $dst
75+ tar cjvf $dst.tar.bz2 $dst
76+ ls -lh *.tar.bz2
5177
52- mkdir $dst/example
78+ - uses : actions/upload-artifact@v4
79+ with :
80+ name : linux-x64
81+ path : ./*.tar.bz2
5382
54- cp -v flutter/sherpa_onnx/example/* $dst/example
55- cp -v LICENSE $dst/
56- cp -v CHANGELOG.md $dst/
83+ build_linux_libs_aarch64 :
84+ name : ${{ matrix.os }}
85+ runs-on : ${{ matrix.os }}
86+ strategy :
87+ fail-fast : false
88+ matrix :
89+ os : [ubuntu-22.04-arm]
5790
58- git status
91+ steps :
92+ - uses : actions/checkout@v4
93+
94+ - name : Update version
95+ shell : bash
96+ run : |
97+ ./new-release.sh
98+ git diff .
5999
60100 - name : Build sherpa-onnx
61101 uses : addnab/docker-run-action@v3
62102 with :
63- image : quay.io/pypa/manylinux2014_x86_64
103+ image : quay.io/pypa/manylinux2014_aarch64
64104 options : |
65105 --volume ${{ github.workspace }}/:/home/runner/work/sherpa-onnx/sherpa-onnx
66106 shell : bash
@@ -92,10 +132,93 @@ jobs:
92132
93133 ls -lh ./install/lib
94134
135+ - name : Create tar file
136+ shell : bash
137+ run : |
138+ mkdir aarch64
139+ dst=aarch64
140+ cp -v build/install/lib/lib* $dst
141+ tar cjvf $dst.tar.bz2 $dst
142+ ls -lh *.tar.bz2
143+
144+ - uses : actions/upload-artifact@v4
145+ with :
146+ name : linux-aarch64
147+ path : ./*.tar.bz2
148+
149+ sherpa_onnx_linux :
150+ needs : [build_linux_libs_x64, build_linux_libs_aarch64]
151+ # if: false
152+ permissions :
153+ id-token : write # Required for authentication using OIDC
154+ name : sherpa_onnx_linux
155+ runs-on : ubuntu-latest
156+
157+ steps :
158+ - uses : actions/checkout@v4
159+
160+ - name : Update version
161+ shell : bash
162+ run : |
163+ ./new-release.sh
164+ git diff .
165+
166+ - name : Fix version
167+ shell : bash
168+ run : |
169+ SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
170+
171+ src_dir=$PWD/flutter/sherpa_onnx_linux
172+ pushd $src_dir
173+ v="version: $SHERPA_ONNX_VERSION"
174+ echo "v: $v"
175+ sed -i.bak s"/^version: .*/$v/" ./pubspec.yaml
176+ rm *.bak
177+ git status
178+ git diff
179+
180+ - name : Retrieve artifact from linux x64
181+ uses : actions/download-artifact@v4
182+ with :
183+ name : linux-x64
184+ path : /tmp
185+
186+ - name : Retrieve artifact from linux aarch64
187+ uses : actions/download-artifact@v4
188+ with :
189+ name : linux-aarch64
190+ path : /tmp
191+
192+ - name : Show files
193+ shell : bash
194+ run : |
195+ cd /tmp
196+ tar xvf x64.tar.bz2
197+ tar xvf aarch64.tar.bz2
198+
199+ echo "----x64---"
200+ ls -lh /tmp/x64/
201+ echo "----aarch64---"
202+ ls -lh /tmp/aarch64/
203+
204+ - name : Copy extra files
205+ shell : bash
206+ run : |
207+ dst=flutter/sherpa_onnx_linux
208+
209+ mkdir $dst/example
210+
211+ cp -v flutter/sherpa_onnx/example/* $dst/example
212+ cp -v LICENSE $dst/
213+ cp -v CHANGELOG.md $dst/
214+
215+ git status
216+
95217 - name : Copy pre-built libs
96218 shell : bash
97219 run : |
98- cp -v build/install/lib/lib*.so* flutter/sherpa_onnx_linux/linux/
220+ cp -v /tmp/x64/lib*.so* flutter/sherpa_onnx_linux/linux/x64
221+ cp -v /tmp/aarch64/lib*.so* flutter/sherpa_onnx_linux/linux/aarch64
99222
100223 mv -v flutter/sherpa_onnx_linux /tmp/to_be_published
101224
@@ -104,8 +227,8 @@ jobs:
104227 - name : Setup Flutter SDK
105228 uses : flutter-actions/setup-flutter@v3
106229 with :
107- channel : stable
108- version : latest
230+ channel : master
231+ version : 3.24.0
109232
110233 - uses : dart-lang/setup-dart@v1
111234
0 commit comments