release.sh
5.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/usr/bin/env bash
set -ex
git config --global user.email "csukuangfj@gmail.com"
git config --global user.name "Fangjun Kuang"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
SHERPA_ONNX_DIR=$(realpath $SCRIPT_DIR/../..)
echo "SCRIPT_DIR: $SCRIPT_DIR"
echo "SHERPA_ONNX_DIR: $SHERPA_ONNX_DIR"
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" $SHERPA_ONNX_DIR/CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
function linux() {
echo "Process linux"
git clone git@github.com:k2-fsa/sherpa-onnx-go-linux.git
cp -v ./sherpa_onnx.go ./sherpa-onnx-go-linux/
cp -v ./_internal/c-api.h ./sherpa-onnx-go-linux/
rm -rf sherpa-onnx-go-linux/lib/x86_64-unknown-linux-gnu/lib*
dst=$(realpath sherpa-onnx-go-linux/lib/x86_64-unknown-linux-gnu)
mkdir t
cd t
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
cp -v sherpa_onnx/lib/*.so* $dst
cd ..
rm -rf t
rm -rf sherpa-onnx-go-linux/lib/aarch64-unknown-linux-gnu/lib*
dst=$(realpath sherpa-onnx-go-linux/lib/aarch64-unknown-linux-gnu)
mkdir t
cd t
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
cp -v sherpa_onnx/lib/*.so* $dst
cd ..
rm -rf t
rm -rf sherpa-onnx-go-linux/lib/arm-unknown-linux-gnueabihf/lib*
dst=$(realpath sherpa-onnx-go-linux/lib/arm-unknown-linux-gnueabihf)
mkdir t
cd t
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-linux_armv7l.whl
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-linux_armv7l.whl
cp -v sherpa_onnx/lib/*.so* $dst
cd ..
rm -rf t
echo "------------------------------"
cd sherpa-onnx-go-linux
git status
git add .
git commit -m "Release v$SHERPA_ONNX_VERSION" && \
git push && \
git tag v$SHERPA_ONNX_VERSION && \
git push origin v$SHERPA_ONNX_VERSION || true
cd ..
rm -rf sherpa-onnx-go-linux
}
function osx() {
echo "Process osx-x64"
git clone git@github.com:k2-fsa/sherpa-onnx-go-macos.git
cp -v ./sherpa_onnx.go ./sherpa-onnx-go-macos/
cp -v ./_internal/c-api.h ./sherpa-onnx-go-macos/
rm -rf sherpa-onnx-go-macos/lib/x86_64-apple-darwin/lib*
dst=$(realpath sherpa-onnx-go-macos/lib/x86_64-apple-darwin/)
mkdir t
cd t
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp39-cp39-macosx_11_0_x86_64.whl
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp39-cp39-macosx_11_0_x86_64.whl
cp -v sherpa_onnx/lib/*.dylib $dst/
cd ..
rm -rf t
echo "process macos arm64"
rm -rf sherpa-onnx-go-macos/lib/aarch64-apple-darwin/lib*
dst=$(realpath sherpa-onnx-go-macos/lib/aarch64-apple-darwin)
mkdir t
cd t
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp39-cp39-macosx_11_0_arm64.whl
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp39-cp39-macosx_11_0_arm64.whl
cp -v sherpa_onnx/lib/*.dylib $dst/
cd ..
rm -rf t
echo "------------------------------"
cd sherpa-onnx-go-macos
git status
git add .
git commit -m "Release v$SHERPA_ONNX_VERSION" && \
git push && \
git tag v$SHERPA_ONNX_VERSION && \
git push origin v$SHERPA_ONNX_VERSION || true
cd ..
rm -rf sherpa-onnx-go-macos
}
function windows() {
echo "Process windows"
git clone git@github.com:k2-fsa/sherpa-onnx-go-windows.git
cp -v ./sherpa_onnx.go ./sherpa-onnx-go-windows/
cp -v ./_internal/c-api.h ./sherpa-onnx-go-windows/
rm -fv sherpa-onnx-go-windows/lib/x86_64-pc-windows-gnu/*
dst=$(realpath sherpa-onnx-go-windows/lib/x86_64-pc-windows-gnu)
mkdir t
cd t
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-win_amd64.whl
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-win_amd64.whl
cp -v sherpa_onnx-${SHERPA_ONNX_VERSION}.data/data/bin/*.dll $dst
cd ..
rm -rf t
rm -fv sherpa-onnx-go-windows/lib/i686-pc-windows-gnu/*
dst=$(realpath sherpa-onnx-go-windows/lib/i686-pc-windows-gnu)
mkdir t
cd t
wget -q https://huggingface.co/csukuangfj/sherpa-onnx-wheels/resolve/main/sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-win32.whl
unzip ./sherpa_onnx-${SHERPA_ONNX_VERSION}-cp38-cp38-win32.whl
cp -v sherpa_onnx-${SHERPA_ONNX_VERSION}.data/data/bin/*.dll $dst
cd ..
rm -rf t
echo "------------------------------"
cd sherpa-onnx-go-windows
git status
git add .
git commit -m "Release v$SHERPA_ONNX_VERSION" && \
git push && \
git tag v$SHERPA_ONNX_VERSION && \
git push origin v$SHERPA_ONNX_VERSION || true
cd ..
rm -rf sherpa-onnx-go-windows
}
windows
linux
osx
rm -fv ~/.ssh/github