forked from csukuangfj/onnxruntime-build
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.5 KB
/
android.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
name: android
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:
windows_x64:
name: Download android onnxruntime lib
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download android onnxruntime lib
shell: bash
run: |
version=${{ env.ONNXRUNTIME_VERSION }}
wget -q https://repo1.maven.org/maven2/com/microsoft/onnxruntime/onnxruntime-android/$version/onnxruntime-android-$version.aar
mv onnxruntime-android-$version.aar onnxruntime-android-$version.zip
unzip onnxruntime-android-$version.zip
- name: Upload v${{ env.ONNXRUNTIME_VERSION }}
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/android-onnxruntime-libs huggingface
cd huggingface
git pull
version=${{ env.ONNXRUNTIME_VERSION }}
src=onnxruntime-android-$version
dst=v$version
rm -rf $dst
mkdir $dst
mv -v ../../$src/headers $dst/
mv -v ../../$src/jni $dst/
git status
git add .
git commit -m "add $version"
git push https://csukuangfj:[email protected]/csukuangfj/android-onnxruntime-libs main