forked from RapidAI/OnnxruntimeBuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 1.79 KB
/
macos.yml
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
name: macos
on:
workflow_dispatch:
jobs:
macos1015:
runs-on: macos-10.15
env:
ONNX_VERSION: v1.11.1
SHARED_PKG_NAME: onnxruntime-1.11.1-macos1015-shared
STATIC_PKG_NAME: onnxruntime-1.11.1-macos1015-static
steps:
# 检出代码
- uses: actions/checkout@v2
# 检出onnxruntime
- name: checkout onnxruntime
uses: actions/checkout@v2
with:
repository: microsoft/onnxruntime
path: onnxruntime-${{ env.ONNX_VERSION }}
ref: ${{ env.ONNX_VERSION }}
submodules: recursive
# 安装openmp
- name: install openmp
run: |
brew install libomp
# 复制编译脚本
- name: copy build script
run: |
cp build-onnxruntime.sh onnxruntime-${{ env.ONNX_VERSION }}
cp onnxruntime_cmake_options.txt onnxruntime-${{ env.ONNX_VERSION }}
# 编译
- name: build
run: |
cd onnxruntime-${{ env.ONNX_VERSION }}
chmod a+x build-onnxruntime.sh &&./build-onnxruntime.sh
# install文件夹改名macos,并使用7z压缩
- name: 7z
run: |
mv onnxruntime-${{ env.ONNX_VERSION }}/build/MacOS/Release/install macos
7z a ${{ env.SHARED_PKG_NAME }}.7z macos
rm -r -f macos
mv onnxruntime-${{ env.ONNX_VERSION }}/build/MacOS/Release/install-static macos
7z a ${{ env.STATIC_PKG_NAME }}.7z macos
rm -r -f macos
# 上传artifact
- name: upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.SHARED_PKG_NAME }}
path: ${{ env.SHARED_PKG_NAME }}.7z
- name: upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.STATIC_PKG_NAME }}
path: ${{ env.STATIC_PKG_NAME }}.7z