mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-04 23:59:56 +00:00
Add nuget release version suffix to support publishing rcs to nuget.org (#15791)
This commit is contained in:
parent
dfac096501
commit
ed31e4b737
4 changed files with 60 additions and 18 deletions
|
|
@ -16,6 +16,7 @@ CMake creates a target to this project
|
|||
<NugetExe Condition= " '$(NugetExe)' == '' ">nuget</NugetExe>
|
||||
<TargetArchitecture Condition=" '$(TargetArchitecture)' == '' ">x64</TargetArchitecture>
|
||||
<IsReleaseBuild Condition=" '$(IsReleaseBuild)' == '' ">false</IsReleaseBuild>
|
||||
<ReleaseVersionSuffix></ReleaseVersionSuffix>
|
||||
<IsLinuxBuild Condition=" '$(IsLinuxBuild)' == '' ">false</IsLinuxBuild>
|
||||
<ExecutionProvider Condition=" '$(ExecutionProvider)' == '' ">None</ExecutionProvider>
|
||||
|
||||
|
|
@ -77,6 +78,7 @@ CMake creates a target to this project
|
|||
<CurrentDate>$([System.DateTime]::UtcNow.ToString(yyyyMMdd))</CurrentDate>
|
||||
<CurrentTime>$([System.DateTime]::UtcNow.ToString(hhmm))</CurrentTime>
|
||||
<PackageVersion>@(MajorVersionNumber)</PackageVersion>
|
||||
<PackageVersion>$(PackageVersion)$(ReleaseVersionSuffix)</PackageVersion>
|
||||
<Version>$(PackageVersion)</Version>
|
||||
<PackageVersion Condition="'$(IsReleaseBuild)'!='True'">$(PackageVersion)-dev-$(CurrentDate)-$(CurrentTime)-$(GitCommitHashShort)</PackageVersion>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -15,15 +15,30 @@ parameters:
|
|||
default: true
|
||||
|
||||
- name: DoEsrp
|
||||
displayName: Run code sign tasks? Must be true if you are doing an Onnx Runtime release.
|
||||
displayName: Run code sign tasks? Must be true if you are doing an ONNX Runtime release
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
- name: IsReleaseBuild
|
||||
displayName: Is a release build? Set it to true if you are doing an Onnx Runtime release.
|
||||
displayName: Is a release build? Set it to true if you are doing an ONNX Runtime release.
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
- name: PreReleaseVersionSuffixString
|
||||
displayName: Suffix added to pre-release package version. Only used if IsReleaseBuild is true. Denotes the type of pre-release package.
|
||||
type: string
|
||||
values:
|
||||
- -alpha
|
||||
- -beta
|
||||
- -rc
|
||||
- none
|
||||
default: none
|
||||
|
||||
- name: PreReleaseVersionSuffixNumber
|
||||
displayName: Number added to pre-release package version. Only used if IsReleaseBuild is true. Denotes the sequence of a pre-release package.
|
||||
type: number
|
||||
default: 0
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: onnxruntime-inference-examples # The name used to reference this repository in the checkout step
|
||||
|
|
@ -37,12 +52,29 @@ resources:
|
|||
ref: aead4d751c2101e23336aa73f2380df83e7a13f3
|
||||
|
||||
stages:
|
||||
- stage: Set_release_version_suffix
|
||||
jobs:
|
||||
- job:
|
||||
steps:
|
||||
- bash: |
|
||||
if [[ "${{ parameters.IsReleaseBuild }}" = True && "${{ parameters.PreReleaseVersionSuffixString }}" != "none" ]]; then
|
||||
echo "##vso[task.setvariable variable=ReleaseVersionSuffix;]${{ parameters.PreReleaseVersionSuffixString }}.${{ parameters.PreReleaseVersionSuffixNumber }}"
|
||||
else
|
||||
echo "##vso[task.setvariable variable=ReleaseVersionSuffix;]''"
|
||||
fi
|
||||
- bash: |
|
||||
echo "IsReleaseBuild is: ${{ parameters.IsReleaseBuild }}"
|
||||
echo "Pre-release version suffix is: ${{ parameters.PreReleaseVersionSuffixString }}"
|
||||
echo "Pre-release version number is: ${{ parameters.PreReleaseVersionSuffixNumber }}"
|
||||
echo "Release version suffix is: $(ReleaseVersionSuffix)"
|
||||
|
||||
- template: templates/c-api-cpu.yml
|
||||
parameters:
|
||||
RunOnnxRuntimeTests: ${{ parameters.RunOnnxRuntimeTests }}
|
||||
DoCompliance: ${{ parameters.DoCompliance }}
|
||||
DoEsrp: ${{ parameters.DoEsrp }}
|
||||
IsReleaseBuild: ${{ parameters.IsReleaseBuild }}
|
||||
ReleaseVersionSuffix: ${ReleaseVersionSuffix}
|
||||
OrtNugetPackageId: 'Microsoft.ML.OnnxRuntime'
|
||||
AdditionalBuildFlags: ''
|
||||
AdditionalWinBuildFlags: '--enable_onnx_tests --enable_wcos'
|
||||
|
|
@ -575,7 +607,7 @@ stages:
|
|||
#
|
||||
# 'Any CPU' is the default (first 'mixed' platform specified in the csproj) so this should be fine.
|
||||
script: |
|
||||
dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=Net6 -p:Configuration=RelWithDebInfo -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId="Microsoft.ML.OnnxRuntime.Gpu" -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}
|
||||
dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=Net6 -p:Configuration=RelWithDebInfo -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId="Microsoft.ML.OnnxRuntime.Gpu" -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }} -p:ReleaseVersionSuffix=${ReleaseVersionSuffix}
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
|
||||
- task: MSBuild@1
|
||||
|
|
@ -593,7 +625,7 @@ stages:
|
|||
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
|
||||
configuration: RelWithDebInfo
|
||||
platform: 'Any CPU'
|
||||
msbuildArguments: '-p:SelectedTargets=PreNet6 -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId="Microsoft.ML.OnnxRuntime.Gpu" -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}'
|
||||
msbuildArguments: '-p:SelectedTargets=PreNet6 -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId="Microsoft.ML.OnnxRuntime.Gpu" -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }} -p:ReleaseVersionSuffix=${ReleaseVersionSuffix}'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
|
||||
- template: templates/win-esrp-dll.yml
|
||||
|
|
@ -617,7 +649,7 @@ stages:
|
|||
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj'
|
||||
configuration: RelWithDebInfo
|
||||
platform: 'Any CPU'
|
||||
msbuildArguments: '-t:CreatePackage -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=Microsoft.ML.OnnxRuntime.Gpu -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}'
|
||||
msbuildArguments: '-t:CreatePackage -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=Microsoft.ML.OnnxRuntime.Gpu -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }} -p:ReleaseVersionSuffix=${ReleaseVersionSuffix}'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
|
||||
- task: BatchScript@1
|
||||
|
|
@ -852,31 +884,31 @@ stages:
|
|||
rename %%~ni.nupkg %%~ni.zip
|
||||
unzip %%~ni.zip -d %%~ni
|
||||
del /Q %%~ni.zip
|
||||
|
||||
|
||||
unzip win-dml-x86.zip -d win-x86
|
||||
mkdir %%~ni\runtimes\win-x86
|
||||
mkdir %%~ni\runtimes\win-x86\native
|
||||
|
||||
|
||||
move win-x86\runtimes\win-x86\native\onnxruntime.dll %%~ni\runtimes\win-x86\native\onnxruntime.dll
|
||||
move win-x86\runtimes\win-x86\native\onnxruntime.lib %%~ni\runtimes\win-x86\native\onnxruntime.lib
|
||||
move win-x86\runtimes\win-x86\native\onnxruntime.pdb %%~ni\runtimes\win-x86\native\onnxruntime.pdb
|
||||
|
||||
|
||||
unzip win-dml-arm64.zip -d win-arm64
|
||||
mkdir %%~ni\runtimes\win-arm64
|
||||
mkdir %%~ni\runtimes\win-arm64\native
|
||||
|
||||
|
||||
move win-arm64\runtimes\win-arm64\native\onnxruntime.dll %%~ni\runtimes\win-arm64\native\onnxruntime.dll
|
||||
move win-arm64\runtimes\win-arm64\native\onnxruntime.lib %%~ni\runtimes\win-arm64\native\onnxruntime.lib
|
||||
move win-arm64\runtimes\win-arm64\native\onnxruntime.pdb %%~ni\runtimes\win-arm64\native\onnxruntime.pdb
|
||||
|
||||
|
||||
unzip win-dml-arm.zip -d win-arm
|
||||
mkdir %%~ni\runtimes\win-arm
|
||||
mkdir %%~ni\runtimes\win-arm\native
|
||||
|
||||
|
||||
move win-arm\runtimes\win-arm\native\onnxruntime.dll %%~ni\runtimes\win-arm\native\onnxruntime.dll
|
||||
move win-arm\runtimes\win-arm\native\onnxruntime.lib %%~ni\runtimes\win-arm\native\onnxruntime.lib
|
||||
move win-arm\runtimes\win-arm\native\onnxruntime.pdb %%~ni\runtimes\win-arm\native\onnxruntime.pdb
|
||||
|
||||
|
||||
pushd %%~ni
|
||||
zip -r ..\%%~ni.zip .
|
||||
popd
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ parameters:
|
|||
type: boolean
|
||||
default: false
|
||||
|
||||
- name: ReleaseVersionSuffix
|
||||
displayName: Suffix added to release package name -alpha, -rc etc.
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
- name: AdditionalBuildFlags
|
||||
displayName: Additional build flags for build.py
|
||||
type: string
|
||||
|
|
@ -399,7 +404,7 @@ stages:
|
|||
#
|
||||
# 'Any CPU' is the default (first 'mixed' platform specified in the csproj) so this should be fine.
|
||||
script: |
|
||||
dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=Net6 -p:Configuration=RelWithDebInfo -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=$(OrtPackageId) -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}
|
||||
dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=Net6 -p:Configuration=RelWithDebInfo -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=$(OrtPackageId) -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }} -p:ReleaseVersionSuffix=${{ parameters.ReleaseVersionSuffix }}
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
|
||||
- task: MSBuild@1
|
||||
|
|
@ -417,7 +422,7 @@ stages:
|
|||
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
|
||||
platform: 'Any CPU'
|
||||
configuration: RelWithDebInfo
|
||||
msbuildArguments: '-p:SelectedTargets=PreNet6 -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=$(OrtPackageId) -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}'
|
||||
msbuildArguments: '-p:SelectedTargets=PreNet6 -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=$(OrtPackageId) -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }} -p:ReleaseVersionSuffix=${{ parameters.ReleaseVersionSuffix }}'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
|
||||
- ${{ if eq(parameters.DoEsrp, true) }}:
|
||||
|
|
@ -442,7 +447,7 @@ stages:
|
|||
solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.proj'
|
||||
platform: 'Any CPU'
|
||||
configuration: RelWithDebInfo
|
||||
msbuildArguments: '-t:CreatePackage -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=$(OrtPackageId) -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}'
|
||||
msbuildArguments: '-t:CreatePackage -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=$(OrtPackageId) -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }} -p:ReleaseVersionSuffix=${{ parameters.ReleaseVersionSuffix }}'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
|
||||
- task: CopyFiles@2
|
||||
|
|
@ -918,5 +923,3 @@ stages:
|
|||
- task: mspremier.PostBuildCleanup.PostBuildCleanup-task.PostBuildCleanup@3
|
||||
displayName: 'Clean Agent Directories'
|
||||
condition: always()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ parameters:
|
|||
type: boolean
|
||||
default: false
|
||||
|
||||
- name: ReleaseVersionSuffix
|
||||
displayName: Suffix added to release package name -alpha, -rc etc.
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
- name: AdditionalBuildFlags
|
||||
displayName: Additional build flags for build.py
|
||||
type: string
|
||||
|
|
@ -238,7 +243,7 @@ stages:
|
|||
#
|
||||
# 'Any CPU' is the default (first 'mixed' platform specified in the csproj) so this should be fine.
|
||||
script: |
|
||||
dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=Net6 -p:Configuration=RelWithDebInfo -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=$(OrtPackageId) -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }}
|
||||
dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=Net6 -p:Configuration=RelWithDebInfo -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId=$(OrtPackageId) -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }} -p:ReleaseVersionSuffix=${{ parameters.ReleaseVersionSuffix }}
|
||||
workingDirectory: '$(Build.SourcesDirectory)\csharp'
|
||||
|
||||
- task: MSBuild@1
|
||||
|
|
|
|||
Loading…
Reference in a new issue