Skip to content

Commit bb58806

Browse files
jignparmpranavsharma
authored andcommitted
Adding versioned dlls to tar/zip packages (#928)
* Adding versioned dlls to tar/zip packages * fix syntax error * fix version name of dylib * minor fix in the target * update pattern for versioned dylib files
1 parent 93d798b commit bb58806

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

tools/ci_build/github/azure-pipelines/c-api-packaging-pipelines.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
parameters:
1313
buildConfig: 'Release'
1414
artifactName: 'onnxruntime-linux-x64-$(OnnxRuntimeVersion)'
15-
libraryName: 'libonnxruntime.so'
15+
libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
1616
commitId: $(OnnxRuntimeGitCommitHash)
1717
- template: templates/clean-agent-build-directory-step.yml
1818

@@ -28,7 +28,7 @@ jobs:
2828
parameters:
2929
buildConfig: 'Release'
3030
artifactName: 'onnxruntime-linux-x86-$(OnnxRuntimeVersion)'
31-
libraryName: 'libonnxruntime.so'
31+
libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
3232
commitId: $(OnnxRuntimeGitCommitHash)
3333
- template: templates/clean-agent-build-directory-step.yml
3434

@@ -44,7 +44,7 @@ jobs:
4444
parameters:
4545
buildConfig: 'Release'
4646
artifactName: 'onnxruntime-linux-x64-gpu-$(OnnxRuntimeVersion)'
47-
libraryName: 'libonnxruntime.so'
47+
libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
4848
commitId: $(OnnxRuntimeGitCommitHash)
4949
- template: templates/clean-agent-build-directory-step.yml
5050

@@ -65,7 +65,7 @@ jobs:
6565
parameters:
6666
buildConfig: 'RelWithDebInfo'
6767
artifactName: 'onnxruntime-osx-x64-$(OnnxRuntimeVersion)'
68-
libraryName: 'libonnxruntime.dylib'
68+
libraryName: 'libonnxruntime.$(OnnxRuntimeVersion).dylib'
6969
commitId: $(OnnxRuntimeGitCommitHash)
7070

7171
- template: templates/clean-agent-build-directory-step.yml

tools/ci_build/github/linux/copy_strip_binary.sh

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ if [[ $LIB_NAME == *.dylib ]]
2626
then
2727
dsymutil $BINARY_DIR/$ARTIFACT_NAME/lib/$LIB_NAME -o $BINARY_DIR/$ARTIFACT_NAME/lib/$LIB_NAME.dSYM
2828
strip -S $BINARY_DIR/$ARTIFACT_NAME/lib/$LIB_NAME
29+
ln -s $LIB_NAME $BINARY_DIR/$ARTIFACT_NAME/lib/libonnxruntime.dylib
30+
elif [[ $LIB_NAME == *.so.* ]]
31+
then
32+
ln -s $LIB_NAME $BINARY_DIR/$ARTIFACT_NAME/lib/libonnxruntime.so
2933
fi
3034
cp $SOURCE_DIR/include/onnxruntime/core/session/onnxruntime_c_api.h $BINARY_DIR/$ARTIFACT_NAME/include
3135
# copy the README, licence and TPN
@@ -34,6 +38,8 @@ cp $SOURCE_DIR/docs/C_API.md $BINARY_DIR/$ARTIFACT_NAME/C_API.md
3438
cp $SOURCE_DIR/LICENSE $BINARY_DIR/$ARTIFACT_NAME/LICENSE
3539
cp $SOURCE_DIR/ThirdPartyNotices.txt $BINARY_DIR/$ARTIFACT_NAME/ThirdPartyNotices.txt
3640
cp $SOURCE_DIR/VERSION_NUMBER $BINARY_DIR/$ARTIFACT_NAME/VERSION_NUMBER
41+
42+
3743
echo $COMMIT_ID > $BINARY_DIR/$ARTIFACT_NAME/GIT_COMMIT_ID
3844

3945
EXIT_CODE=$?

0 commit comments

Comments
 (0)