@@ -74,13 +74,15 @@ jobs:
7474 run : |
7575 wget -O cmake.sh "https://github.com/Kitware/CMake/releases/download/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION }}-linux-x86_64.sh"
7676 sudo bash cmake.sh --skip-license --prefix=/usr/local
77+
7778 - name : Configure build environment
7879 if : steps.cache-build-result.outputs.cache-hit != 'true'
7980 run : |
8081 # Required for arm build
8182 # https://github.com/microsoft/onnxruntime/issues/4189#issuecomment-642528278
8283 echo 'string(APPEND CMAKE_C_FLAGS " -latomic")' >> cmake/CMakeLists.txt
8384 echo 'string(APPEND CMAKE_CXX_FLAGS " -latomic")' >> cmake/CMakeLists.txt
85+
8486 # Prevent Exec Format Error during cross-compiling
8587 if [ -n "${{ matrix.ld_symlink_name }}" ]; then
8688 sudo ln -s /usr/${{ matrix.arch }}/lib /lib/${{ matrix.arch }}
@@ -102,13 +104,17 @@ jobs:
102104 - name : Organize artifact
103105 run : |
104106 mkdir artifact
107+
105108 # copy shared lib
106109 mkdir artifact/lib
110+
107111 NAME=$(basename ${{ matrix.result_dir }}/libonnxruntime.so.*)
108112 cp "${{ matrix.result_dir }}/${NAME}" artifact/lib/
109113 ln -s "${NAME}" artifact/lib/libonnxruntime.so
114+
110115 # copy header files
111116 mkdir artifact/include
117+
112118 readarray -t HEADERS <<EOF
113119 onnxruntime/core/session/onnxruntime_c_api.h
114120 onnxruntime/core/session/onnxruntime_cxx_api.h
@@ -118,17 +124,20 @@ jobs:
118124 onnxruntime/core/session/onnxruntime_run_options_config_keys.h
119125 onnxruntime/core/framework/provider_options.h
120126 EOF
127+
121128 for path in "${HEADERS[@]}"; do
122129 cp "include/${path}" ./artifact/include/
123130 done
131+
124132 # copy docs & license
125133 cp VERSION_NUMBER ./artifact/
126134 cp LICENSE ./artifact/
127135 cp ThirdPartyNotices.txt ./artifact/
128136 cp docs/Privacy.md ./artifact/
129137 cp README.md ./artifact/
138+
130139 echo "$(git rev-parse HEAD)" >> ./artifact/GIT_COMMIT_ID
131-
140+
132141 - name : Upload artifact
133142 uses : actions/upload-artifact@v2
134143 with :
@@ -137,15 +146,18 @@ jobs:
137146 retention-days : 14
138147
139148 - name : Generate RELEASE_NAME
149+ if : github.event.release.tag_name != '' # If release
140150 run : |
141151 echo "RELEASE_NAME=${{ matrix.artifact_name }}-${{ env.ONNXRUNTIME_VERSION }}" >> $GITHUB_ENV
142152
143153 - name : Rearchive artifact
154+ if : github.event.release.tag_name != '' # If release
144155 run : |
145156 mv artifact/ "${{ env.RELEASE_NAME }}"
146157 tar cfz "${{ env.RELEASE_NAME }}.tgz" "${{ env.RELEASE_NAME }}/"
147158
148159 - name : Upload to Release
160+ if : github.event.release.tag_name != '' # If release
149161 uses : svenstaro/upload-release-action@v2
150162 with :
151163 repo_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments