Skip to content

Commit

Permalink
fix builder 1.16.3
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminwan committed Feb 4, 2024
1 parent 596ae35 commit 955ccfc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 24 deletions.
51 changes: 33 additions & 18 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
env:
SHARED_PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-${{ matrix.list.arch }}-shared
STATIC_PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-${{ matrix.list.arch }}-static
JAVA_PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-android-${{ matrix.list.arch }}-java
JAVA_PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-${{ matrix.list.arch }}-java
BUILD_SCRIPT: build-onnxruntime-android.sh

steps:
Expand Down Expand Up @@ -85,9 +85,8 @@ jobs:
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-android-${{ matrix.list.arch }}/Release/install-static ${{ matrix.list.arch }}
7z a ${{ env.STATIC_PKG_NAME }}.7z ${{ matrix.list.arch }}
rm -r -f ${{ matrix.list.arch }}
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-android-${{ matrix.list.arch }}/Release/java/build ${{ env.JAVA_PKG_NAME }}
rm -r -f ${{ env.JAVA_PKG_NAME }}/android
7z a ${{ env.JAVA_PKG_NAME }}.7z ${{ env.JAVA_PKG_NAME }}
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-android-${{ matrix.list.arch }}/Release/java/build/libs ${{ matrix.list.arch }}
7z a ${{ env.JAVA_PKG_NAME }}.7z ${{ matrix.list.arch }}
# 上传artifact
- name: upload
Expand Down Expand Up @@ -120,7 +119,9 @@ jobs:
- { onnx: v1.16.3 }

env:
PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-android
SHARED_PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-android-shared
STATIC_PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-android-static
JAVA_PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-android-java

steps:
# 检出代码
Expand Down Expand Up @@ -159,27 +160,41 @@ jobs:
tree artifacts
# 合并
- name: merge
- name: merge shared
run: |
mkdir onnxruntime-android
mkdir onnxruntime-android-shared
mv artifacts/*/*-shared.7z artifacts/
find artifacts/*-shared.7z -exec 7z x {} -aoa -oonnxruntime-android \;
pushd onnxruntime-android
find artifacts/*-shared.7z -exec 7z x {} -aoa -oonnxruntime-android-shared \;
find artifacts/*-shared.7z -exec rm {} \;
pushd onnxruntime-android-shared
echo "message(\"OnnxRuntime Path: \${CMAKE_CURRENT_LIST_DIR}/\${ANDROID_ABI}\")" > OnnxRuntimeWrapper.cmake
echo "set(OnnxRuntime_DIR \"\${CMAKE_CURRENT_LIST_DIR}/\${ANDROID_ABI}\")" >> OnnxRuntimeWrapper.cmake
popd
7z a ${{ env.PKG_NAME }}-shared.7z onnxruntime-android
rm -r -f onnxruntime-android
mkdir onnxruntime-android
7z a ${{ env.SHARED_PKG_NAME }}.7z onnxruntime-android-shared
rm -r -f onnxruntime-android-shared
- name: merge static
run: |
mkdir onnxruntime-android-static
mv artifacts/*/*-static.7z artifacts/
find artifacts/*-static.7z -exec 7z x {} -aoa -oonnxruntime-android \;
pushd onnxruntime-android
find artifacts/*-static.7z -exec 7z x {} -aoa -oonnxruntime-android-static \;
find artifacts/*-static.7z -exec rm {} \;
pushd onnxruntime-android-static
echo "message(\"OnnxRuntime Path: \${CMAKE_CURRENT_LIST_DIR}/\${ANDROID_ABI}\")" > OnnxRuntimeWrapper.cmake
echo "set(OnnxRuntime_DIR \"\${CMAKE_CURRENT_LIST_DIR}/\${ANDROID_ABI}\")" >> OnnxRuntimeWrapper.cmake
popd
7z a ${{ env.PKG_NAME }}-static.7z onnxruntime-android
rm -r -f onnxruntime-android
find artifacts/*-static.7z -exec rm {} \;
7z a ${{ env.STATIC_PKG_NAME }}.7z onnxruntime-android-static
rm -r -f onnxruntime-android-static
- name: merge java
run: |
mkdir onnxruntime-android-java
mv artifacts/*/*-java.7z artifacts/
find artifacts/*-java.7z -exec 7z x {} -aoa -oonnxruntime-android-java \;
find artifacts/*-java.7z -exec rm {} \;
7z a ${{ env.JAVA_PKG_NAME }}.7z onnxruntime-android-java
rm -r -f onnxruntime-android-java
# 创建release 上传release
# https://github.com/marketplace/actions/create-release
Expand All @@ -188,7 +203,7 @@ jobs:
with:
prerelease: false
bodyFile: release.md
artifacts: ${{ env.PKG_NAME }}-shared.7z,${{ env.PKG_NAME }}-static.7z,artifacts/*/*-java.7z
artifacts: ${{ env.SHARED_PKG_NAME }}.7z,${{ env.STATIC_PKG_NAME }}.7z,${{ env.JAVA_PKG_NAME }}.7z
allowUpdates: true
artifactContentType: application/x-7z-compressed
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ jobs:
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-Linux/Release/install-static linux
7z a ${{ env.STATIC_PKG_NAME }}.7z linux
rm -r -f linux
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-Linux/Release/java/build ${{ env.JAVA_PKG_NAME }}
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-Linux/Release/java/build/libs ${{ env.JAVA_PKG_NAME }}
7z a ${{ env.JAVA_PKG_NAME }}.7z ${{ env.JAVA_PKG_NAME }}
rm -r -f java
# 上传artifact
- name: upload
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- { onnx: v1.16.3 }
list:
- { os_ver: 11 }
- { os_ver: 13-arm64 }
- { os_ver: 14-arm64 }

runs-on: macos-${{ matrix.list.os_ver }}

Expand Down Expand Up @@ -72,9 +72,8 @@ jobs:
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-Darwin/Release/install-static macos
7z a ${{ env.STATIC_PKG_NAME }}.7z macos
rm -r -f macos
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-Darwin/Release/java/build ${{ env.JAVA_PKG_NAME }}
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-Darwin/Release/java/build/libs ${{ env.JAVA_PKG_NAME }}
7z a ${{ env.JAVA_PKG_NAME }}.7z ${{ env.JAVA_PKG_NAME }}
rm -r -f java
# 上传artifact
- name: upload
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
7z a ${{ env.STATIC_PKG_NAME }}.7z windows-x64 windows-x86
rm windows-x64 -r -fo
rm windows-x86 -r -fo
mv onnxruntime-${{ matrix.ver.onnx }}/build-x64-${{ matrix.list.vs_ver }}-${{ matrix.crt }}/Release/java/build ${{ env.JAVA_PKG_NAME }}
mv onnxruntime-${{ matrix.ver.onnx }}/build-x64-${{ matrix.list.vs_ver }}-${{ matrix.crt }}/Release/java/build/libs ${{ env.JAVA_PKG_NAME }}
7z a ${{ env.JAVA_PKG_NAME }}.7z ${{ env.JAVA_PKG_NAME }}
# 上传artifact
Expand Down

0 comments on commit 955ccfc

Please sign in to comment.