From 128328a6ae0df9c495f51fd0bfa3593ffcbd4a16 Mon Sep 17 00:00:00 2001 From: Dan Siegel Date: Wed, 24 Jul 2019 08:04:08 -0700 Subject: [PATCH] release script in yml - script shouldn't be published --- Source/build/Process-Release.ps1 | 43 -------------------------------- Source/build/azure-pipelines.yml | 43 +++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 44 deletions(-) delete mode 100644 Source/build/Process-Release.ps1 diff --git a/Source/build/Process-Release.ps1 b/Source/build/Process-Release.ps1 deleted file mode 100644 index 224d90558..000000000 --- a/Source/build/Process-Release.ps1 +++ /dev/null @@ -1,43 +0,0 @@ -try { - $artifactDirectory = Join-Path -Path $env:PIPELINE_WORKSPACE -ChildPath 'NuGet' - - Write-Host "Currect working directory - $artifactDirectory" - - $nupkg = Get-ChildItem -Path $artifactDirectory -Filter *.nupkg -Recurse | Select-Object -First 1 - - if($null -eq $nupkg) - { - Throw "No NuGet Package could be found in the current directory" - } - - Write-Host "Package Name $($nupkg.Name)" - $nupkg.Name -match '^(.*?)\.((?:\.?[0-9]+){3,}(?:[-a-z]+)?)\.nupkg$' - $VersionName = $Matches[2] - $IsPreview = $VersionName -match '-pre$' - $ReleaseDisplayName = $VersionName - $artifacts = "$env:PIPELINE_WORKSPACE/Release" - - if($null -eq $env:IS_PREVIEW) - { - Write-Output ("##vso[task.setvariable variable=IS_PREVIEW;]$IsPreview") - } - - if($true -eq $IsPreview) - { - $baseVersion = $VersionName.Split('-')[0] - $ReleaseDisplayName = "$baseVersion - Preview" - } - - Write-Host "Version Name - $VersionName" - Write-Host "Release Display Name - $ReleaseDisplayName" - Write-Host "DLL Artifacts - $artifacts" - - Write-Output ("##vso[task.setvariable variable=VersionName;]$VersionName") - Write-Output ("##vso[task.setvariable variable=ReleaseDisplayName;]$ReleaseDisplayName") - Write-Output ("##vso[task.setvariable variable=DLLArtifactsPath;]$artifacts") - Write-Output ("##vso[task.setvariable variable=DLLArtifactsZip;]$artifacts.zip") -} -catch { - Write-Error $_ - exit 1 -} \ No newline at end of file diff --git a/Source/build/azure-pipelines.yml b/Source/build/azure-pipelines.yml index 6e40b8630..d2f6074cd 100644 --- a/Source/build/azure-pipelines.yml +++ b/Source/build/azure-pipelines.yml @@ -83,7 +83,48 @@ stages: runOnce: deploy: steps: - - powershell: Source/build/Process-Release.ps1 + - powershell: | + try { + $artifactDirectory = Join-Path -Path $env:PIPELINE_WORKSPACE -ChildPath 'NuGet' + Write-Host "Currect working directory - $artifactDirectory" + $nupkg = Get-ChildItem -Path $artifactDirectory -Filter *.nupkg -Recurse | Select-Object -First 1 + + if($null -eq $nupkg) + { + Throw "No NuGet Package could be found in the current directory" + } + + Write-Host "Package Name $($nupkg.Name)" + $nupkg.Name -match '^(.*?)\.((?:\.?[0-9]+){3,}(?:[-a-z]+)?)\.nupkg$' + $VersionName = $Matches[2] + $IsPreview = $VersionName -match '-pre$' + $ReleaseDisplayName = $VersionName + $artifacts = "$env:PIPELINE_WORKSPACE/Release" + + if($null -eq $env:IS_PREVIEW) + { + Write-Output ("##vso[task.setvariable variable=IS_PREVIEW;]$IsPreview") + } + + if($true -eq $IsPreview) + { + $baseVersion = $VersionName.Split('-')[0] + $ReleaseDisplayName = "$baseVersion - Preview" + } + + Write-Host "Version Name - $VersionName" + Write-Host "Release Display Name - $ReleaseDisplayName" + Write-Host "DLL Artifacts - $artifacts" + + Write-Output ("##vso[task.setvariable variable=VersionName;]$VersionName") + Write-Output ("##vso[task.setvariable variable=ReleaseDisplayName;]$ReleaseDisplayName") + Write-Output ("##vso[task.setvariable variable=DLLArtifactsPath;]$artifacts") + Write-Output ("##vso[task.setvariable variable=DLLArtifactsZip;]$artifacts.zip") + } + catch { + Write-Error $_ + exit 1 + } displayName: Process Artifacts for Release - task: ArchiveFiles@2