fix version number for tarball packages (#600)

* add variables for version number and git commit hash

* fix typo

* fix typo

* some logging

* some logging

* some logging

* some logging

* some logging

* some logging

* some logging

* some logging

* some more edits to see generic scripts can print

* working

* fixing windows git hash

* try quoted echo

* fix git rev-parse

* echo without quotes

* removed commit hash from artifact filename, added long commit hash as a file inside

* added the missing commit id parameter

* fix windows pipeline

* keep only win 64, others disabled

* remove disabling conditions
This commit is contained in:
shahasad 2019-03-12 17:55:08 -07:00 committed by GitHub
parent b452151baf
commit bf43ac41aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 10 deletions

View file

@ -4,42 +4,48 @@ jobs:
pool: Linux-CPU
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml
- script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -x " --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)"'
displayName: 'Build and Test Linux on Docker'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x64'
artifactName: 'onnxruntime-linux-x64-$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.so'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml
- job: Linux_C_API_Packaging_CPU_x86
pool: Linux-CPU
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml
- script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -a x86 -x " --x86 --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)"'
displayName: 'Build and Test Linux on Docker'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x86'
artifactName: 'onnxruntime-linux-x86-$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.so'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml
- job: Linux_C_API_Packaging_GPU_x64
pool: Linux-GPU
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml
- script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d gpu -c cuda9.1-cudnn7.1 -r $(Build.BinariesDirectory) -x " --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)"'
displayName: 'Build and Test Linux on Docker'
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'Release'
artifactName: 'onnxruntime-linux-x64-gpu'
artifactName: 'onnxruntime-linux-x64-gpu-$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.so'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml
@ -47,7 +53,10 @@ jobs:
pool:
vmImage: 'macOS-10.13'
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml
- script: |
sudo xcode-select --switch /Applications/Xcode_10.app/Contents/Developer
python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --use_openmp --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --build_shared_lib --config RelWithDebInfo --enable_onnx_tests --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum)
@ -55,9 +64,10 @@ jobs:
- template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
parameters:
buildConfig: 'RelWithDebInfo'
artifactName: 'onnxruntime-osx-x64'
artifactName: 'onnxruntime-osx-x64-$(OnnxRuntimeVersion)'
libraryName: 'libonnxruntime.dylib'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml
@ -70,6 +80,7 @@ jobs:
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml
- template: templates/windows-build-tools-setup-steps.yml
parameters:
@ -87,8 +98,8 @@ jobs:
- template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: $(buildConfig)
artifactName: 'onnxruntime-win-$(buildArch)'
artifactName: 'onnxruntime-win-$(buildArch)-$(OnnxRuntimeVersion)'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml
@ -101,6 +112,7 @@ jobs:
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml
- template: templates/windows-build-tools-setup-steps.yml
parameters:
@ -118,8 +130,8 @@ jobs:
- template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: $(buildConfig)
artifactName: 'onnxruntime-win-$(buildArch)'
artifactName: 'onnxruntime-win-$(buildArch)-$(OnnxRuntimeVersion)'
commitId: $(OnnxRuntimeGitCommitHash)
- template: templates/clean-agent-build-directory-step.yml
@ -132,6 +144,7 @@ jobs:
steps:
- template: templates/set-test-data-variables-step.yml
- template: templates/set-version-number-variables-step.yml
- task: CmdLine@2
displayName: 'Set CUDA 9.1 path'
@ -164,7 +177,8 @@ jobs:
- template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
parameters:
buildConfig: $(buildConfig)
artifactName: 'onnxruntime-win-gpu-$(buildArch)'
artifactName: 'onnxruntime-win-$(buildArch)-gpu-$(OnnxRuntimeVersion)'
commitId: $(OnnxRuntimeGitCommitHash)
- task: PowerShell@2
displayName: 'Clean up Cuda Path 9.1'

View file

@ -4,6 +4,7 @@ parameters:
buildConfig: 'RelWithDebInfo'
artifactName: 'onnxruntime-linux-x64'
libraryName: 'libonnxruntime.so'
commitId: ''
steps:
- task: CmdLine@2
displayName: 'Copy build artifacts for zipping'
@ -20,6 +21,8 @@ steps:
cp $(Build.SourcesDirectory)/docs/C_API.md $(Build.BinariesDirectory)/${{parameters.artifactName}}/C_API.md
cp $(Build.SourcesDirectory)/LICENSE $(Build.BinariesDirectory)/${{parameters.artifactName}}/LICENSE
cp $(Build.SourcesDirectory)/ThirdPartyNotices.txt $(Build.BinariesDirectory)/${{parameters.artifactName}}/ThirdPartyNotices.txt
cp $(Build.SourcesDirectory)/VERSION_NUMBER $(Build.BinariesDirectory)/${{parameters.artifactName}}/VERSION_NUMBER
echo ${{parameters.commitId}} > $(Build.BinariesDirectory)/${{parameters.artifactName}}/GIT_COMMIT_ID
workingDirectory: '$(Build.BinariesDirectory)/${{parameters.buildConfig}}'

View file

@ -3,6 +3,7 @@
parameters:
buildConfig: 'RelWithDebInfo'
artifactName: 'onnxruntime-win-x64'
comitId: ''
steps:
- task: CmdLine@2
displayName: 'Copy build artifacts for zipping'
@ -21,6 +22,8 @@ steps:
copy $(Build.SourcesDirectory)\docs\C_API.md $(Build.BinariesDirectory)\${{parameters.artifactName}}\C_API.md
copy $(Build.SourcesDirectory)\LICENSE $(Build.BinariesDirectory)\${{parameters.artifactName}}\LICENSE
copy $(Build.SourcesDirectory)\ThirdPartyNotices.txt $(Build.BinariesDirectory)\${{parameters.artifactName}}\ThirdPartyNotices.txt
copy $(Build.SourcesDirectory)/VERSION_NUMBER $(Build.BinariesDirectory)\${{parameters.artifactName}}\VERSION_NUMBER
@echo ${{parameters.commitId}} > $(Build.BinariesDirectory)\${{parameters.artifactName}}\GIT_COMMIT_ID
workingDirectory: '$(Build.BinariesDirectory)\${{parameters.buildConfig}}'

View file

@ -0,0 +1,30 @@
# Sets version number from VERSION.txt into a variable. As well as the git commit hash.
steps:
- task: CmdLine@2
displayName: 'Set Version Number variables for Windows'
inputs:
script: |
SETLOCAL EnableDelayedExpansion
set /p _OnnxRuntimeVersion=<$(Build.SourcesDirectory)\VERSION_NUMBER
@echo ##vso[task.setvariable variable=OnnxRuntimeVersion;]%_OnnxRuntimeVersion%
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse HEAD`) DO (
@echo ##vso[task.setvariable variable=OnnxRuntimeGitCommitHash;]%%F
)
workingDirectory: '$(Build.SourcesDirectory)'
condition: eq(variables['Agent.OS'], 'Windows_NT')
- task: CmdLine@2
displayName: 'Set version number variables for Unix'
inputs:
script: |
_OnnxRuntimeVersion=$(head -1 $(Build.SourcesDirectory)/VERSION_NUMBER)
echo "##vso[task.setvariable variable=OnnxRuntimeVersion;]$_OnnxRuntimeVersion"
_OnnxRuntimeGitCommitHash=$(git rev-parse HEAD)
echo "##vso[task.setvariable variable=OnnxRuntimeGitCommitHash;]$_OnnxRuntimeGitCommitHash"
workingDirectory: '$(Build.SourcesDirectory)'
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))