forked from csukuangfj/onnxruntime-build
-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (125 loc) · 4.84 KB
/
aarch64-217.yaml
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
name: aarch64-glibc217
on:
workflow_dispatch:
inputs:
version:
description: "Version information (e.g., 1.19.0)"
required: true
permissions:
contents: write
env:
ONNXRUNTIME_VERSION:
|- # Enter release tag name or version name in workflow_dispatch. Appropriate version if not specified
${{ github.event.release.tag_name || github.event.inputs.version || '1.19.0' }}
jobs:
linux-glibc217:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
if: steps.cache-build-result.outputs.cache-hit != 'true'
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Cache build result for ${{ env.ONNXRUNTIME_VERSION }}
id: cache-build-result
uses: actions/cache@v2
with:
path: onnxruntime-linux-aarch64-static_lib-${{ env.ONNXRUNTIME_VERSION }}-glibc2_17
key: onnxruntime-linux-aarch64-static_lib-${{ env.ONNXRUNTIME_VERSION }}-glibc2_17
- name: Update ONNX Runtime
if: steps.cache-build-result.outputs.cache-hit != 'true'
run: |
echo $ONNXRUNTIME_VERSION > ONNXRUNTIME_VERSION
git submodule update --init --depth=1 onnxruntime
cd onnxruntime
git fetch origin tag v$ONNXRUNTIME_VERSION
git checkout v$ONNXRUNTIME_VERSION
- name: Build onnxruntime ${{ env.ONNXRUNTIME_VERSION }}
if: steps.cache-build-result.outputs.cache-hit != 'true'
uses: addnab/docker-run-action@v3
with:
image: quay.io/pypa/manylinux2014_aarch64
options: |
--volume ${{ github.workspace }}/:/shared/
shell: bash
run: |
uname -a
gcc --version
find /opt -name "python*"
export PATH=/opt/_internal/cpython-3.8.19/bin:$PATH
python3 --version
python3 -m pip install ninja cmake
export PATH=/shared/toolchain/bin:$PATH
cmake --version
cd /shared
echo "----------"
ls -lh
echo "----------"
export CMAKE_OPTIONS="--compile-no-warning-as-error -Donnxruntime_BUILD_UNIT_TESTS=OFF"
git config --global --add safe.directory /shared/onnxruntime
git config --global --add safe.directory /shared
./build-static_lib.sh
build_dir=output
chmod a=rwx $build_dir
ls -lh $build_dir
ls -lh $build_dir/*
mv $build_dir/static_lib/lib64 $build_dir/static_lib/lib
ls -lh $build_dir/static_lib
- name: Collect result
if: steps.cache-build-result.outputs.cache-hit != 'true'
shell: bash
run: |
ls -lh output/static_lib/
ls -lh output/static_lib/include
ls -lh output/static_lib/lib
dst=onnxruntime-linux-aarch64-static_lib-${ONNXRUNTIME_VERSION}-glibc2_17
mkdir $dst
cp -av output/static_lib/* $dst
zip -r ${dst}.zip $dst/
- name: Upload v${{ env.ONNXRUNTIME_VERSION }}
if: steps.cache-build-result.outputs.cache-hit != 'true'
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
file: "./*.zip"
overwrite: true
repo_name: csukuangfj/onnxruntime-libs
repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
tag: v${{ env.ONNXRUNTIME_VERSION }}
- name: Publish to huggingface
if: steps.cache-build-result.outputs.cache-hit != 'true'
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v2
with:
max_attempts: 20
timeout_seconds: 200
shell: bash
command: |
git config --global user.email "[email protected]"
git config --global user.name "Fangjun Kuang"
rm -rf huggingface
export GIT_LFS_SKIP_SMUDGE=1
export GIT_CLONE_PROTECTION_ACTIVE=false
ls -lh
git clone https://huggingface.co/csukuangfj/onnxruntime-libs huggingface
cd huggingface
git pull
name=onnxruntime-linux-aarch64-static_lib-${ONNXRUNTIME_VERSION}-glibc2_17.zip
cp -v ../$name .
git status
git add .
git commit -m "add $name"
git push https://csukuangfj:[email protected]/csukuangfj/onnxruntime-libs main
- uses: actions/upload-artifact@v3
if: steps.cache-build-result.outputs.cache-hit != 'true'
with:
name: onnxruntime-linux-aarch64-static_lib-${ONNXRUNTIME_VERSION}-glibc2_17
path: onnxruntime-linux-aarch64-static_lib*