@@ -83,7 +83,48 @@ stages:
8383 runOnce :
8484 deploy :
8585 steps :
86- - powershell : Source/build/Process-Release.ps1
86+ - powershell : |
87+ try {
88+ $artifactDirectory = Join-Path -Path $env:PIPELINE_WORKSPACE -ChildPath 'NuGet'
89+ Write-Host "Currect working directory - $artifactDirectory"
90+ $nupkg = Get-ChildItem -Path $artifactDirectory -Filter *.nupkg -Recurse | Select-Object -First 1
91+
92+ if($null -eq $nupkg)
93+ {
94+ Throw "No NuGet Package could be found in the current directory"
95+ }
96+
97+ Write-Host "Package Name $($nupkg.Name)"
98+ $nupkg.Name -match '^(.*?)\.((?:\.?[0-9]+){3,}(?:[-a-z]+)?)\.nupkg$'
99+ $VersionName = $Matches[2]
100+ $IsPreview = $VersionName -match '-pre$'
101+ $ReleaseDisplayName = $VersionName
102+ $artifacts = "$env:PIPELINE_WORKSPACE/Release"
103+
104+ if($null -eq $env:IS_PREVIEW)
105+ {
106+ Write-Output ("##vso[task.setvariable variable=IS_PREVIEW;]$IsPreview")
107+ }
108+
109+ if($true -eq $IsPreview)
110+ {
111+ $baseVersion = $VersionName.Split('-')[0]
112+ $ReleaseDisplayName = "$baseVersion - Preview"
113+ }
114+
115+ Write-Host "Version Name - $VersionName"
116+ Write-Host "Release Display Name - $ReleaseDisplayName"
117+ Write-Host "DLL Artifacts - $artifacts"
118+
119+ Write-Output ("##vso[task.setvariable variable=VersionName;]$VersionName")
120+ Write-Output ("##vso[task.setvariable variable=ReleaseDisplayName;]$ReleaseDisplayName")
121+ Write-Output ("##vso[task.setvariable variable=DLLArtifactsPath;]$artifacts")
122+ Write-Output ("##vso[task.setvariable variable=DLLArtifactsZip;]$artifacts.zip")
123+ }
124+ catch {
125+ Write-Error $_
126+ exit 1
127+ }
87128 displayName: Process Artifacts for Release
88129
89130 - task : ArchiveFiles@2
0 commit comments