From a6525aa080d9949073ce8a7a94e817aa5c591ff3 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Fri, 17 Jan 2025 13:26:45 -0800 Subject: [PATCH] Fixed release pipeline errors and switched to KS3 (#24751) (#24815) * Fixed an error in the release pipeline * Fixed ReleaseTag and Version variable in validate packages * Switched from Netlock to KS3 --------- Co-authored-by: Justin Chung <124807742+jshigetomi@users.noreply.github.com> Co-authored-by: Justin Chung --- .pipelines/PowerShell-Release-Official.yml | 2 +- .../templates/release-SetReleaseTagandContainerName.yml | 6 +++--- .pipelines/templates/release-create-msix.yml | 2 +- .pipelines/templates/release-githubtasks.yml | 1 + .pipelines/templates/release-validate-globaltools.yml | 4 ++-- .pipelines/templates/release-validate-packagenames.yml | 2 +- .pipelines/templates/release-validate-sdk.yml | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.pipelines/PowerShell-Release-Official.yml b/.pipelines/PowerShell-Release-Official.yml index 6a17139e05..30c820cabc 100644 --- a/.pipelines/PowerShell-Release-Official.yml +++ b/.pipelines/PowerShell-Release-Official.yml @@ -88,7 +88,7 @@ extends: featureFlags: WindowsHostVersion: Version: 2022 - Network: Netlock + Network: KS3 cloudvault: enabled: false globalSdl: diff --git a/.pipelines/templates/release-SetReleaseTagandContainerName.yml b/.pipelines/templates/release-SetReleaseTagandContainerName.yml index 667132f5f9..407a3a8f91 100644 --- a/.pipelines/templates/release-SetReleaseTagandContainerName.yml +++ b/.pipelines/templates/release-SetReleaseTagandContainerName.yml @@ -15,12 +15,12 @@ steps: displayName: Set Release Tag - pwsh: | - $azureVersion = '$(ReleaseTag)'.ToLowerInvariant() -replace '\.', '-' - $vstsCommandString = "vso[task.setvariable variable=AzureVersion]$azureVersion" + $azureVersion = '$(OutputReleaseTag.ReleaseTag)'.ToLowerInvariant() -replace '\.', '-' + $vstsCommandString = "vso[task.setvariable variable=AzureVersion;isOutput=true]$azureVersion" Write-Host "sending " + $vstsCommandString Write-Host "##$vstsCommandString" - $version = '$(ReleaseTag)'.ToLowerInvariant().Substring(1) + $version = '$(OutputReleaseTag.ReleaseTag)'.ToLowerInvariant().Substring(1) $vstsCommandString = "vso[task.setvariable variable=Version;isOutput=true]$version" Write-Host ("sending " + $vstsCommandString) Write-Host "##$vstsCommandString" diff --git a/.pipelines/templates/release-create-msix.yml b/.pipelines/templates/release-create-msix.yml index 448a46c119..3b1573d977 100644 --- a/.pipelines/templates/release-create-msix.yml +++ b/.pipelines/templates/release-create-msix.yml @@ -96,7 +96,7 @@ jobs: azurePowerShellVersion: LatestVersion pwsh: true inline: | - $containerName = '$(AzureVersion)-private' + $containerName = '$(OutputVersion.AzureVersion)-private' $storageAccount = '$(StorageAccount)' $storageContext = New-AzStorageContext -StorageAccountName $storageAccount -UseConnectedAccount diff --git a/.pipelines/templates/release-githubtasks.yml b/.pipelines/templates/release-githubtasks.yml index 4af3c97320..31e66b793a 100644 --- a/.pipelines/templates/release-githubtasks.yml +++ b/.pipelines/templates/release-githubtasks.yml @@ -63,6 +63,7 @@ jobs: pwsh: true script: | Import-module '$(Pipeline.Workspace)/ToolArtifact/GitHubRelease.psm1' + $releaseVersion = '$(ReleaseTag)' -replace '^v','' Write-Verbose -Verbose "Available modules: " Get-Module | Write-Verbose -Verbose diff --git a/.pipelines/templates/release-validate-globaltools.yml b/.pipelines/templates/release-validate-globaltools.yml index fba8b7b3f9..0820e5591f 100644 --- a/.pipelines/templates/release-validate-globaltools.yml +++ b/.pipelines/templates/release-validate-globaltools.yml @@ -85,7 +85,7 @@ jobs: $packageName = '${{ parameters.globalToolPackageName }}' Write-Verbose -Verbose "Installing $packageName" - dotnet tool install --add-source "$ENV:PIPELINE_WORKSPACE/PSPackagesOfficial/drop_nupkg_build_nupkg" --tool-path $toolPath --version '$(Version)' $packageName + dotnet tool install --add-source "$ENV:PIPELINE_WORKSPACE/PSPackagesOfficial/drop_nupkg_build_nupkg" --tool-path $toolPath --version '$(OutputVersion.Version)' $packageName Get-ChildItem -Path $toolPath @@ -133,7 +133,7 @@ jobs: $versionFound = & $toolPath -c '$PSVersionTable.PSVersion.ToString()' - if ( '$(Version)' -ne $versionFound) + if ( '$(OutputVersion.Version)' -ne $versionFound) { throw "Expected version of global tool not found. Installed version is $versionFound" } diff --git a/.pipelines/templates/release-validate-packagenames.yml b/.pipelines/templates/release-validate-packagenames.yml index 8b08f8d843..3e2987591a 100644 --- a/.pipelines/templates/release-validate-packagenames.yml +++ b/.pipelines/templates/release-validate-packagenames.yml @@ -50,7 +50,7 @@ jobs: inline: | $storageAccount = Get-AzStorageAccount -ResourceGroupName '$(StorageResourceGroup)' -Name '$(StorageAccount)' $ctx = $storageAccount.Context - $container = '$(AzureVersion)' + $container = '$(OutputVersion.AzureVersion)' $destinationPath = '$(System.ArtifactsDirectory)' $blobList = Get-AzStorageBlob -Container $container -Context $ctx diff --git a/.pipelines/templates/release-validate-sdk.yml b/.pipelines/templates/release-validate-sdk.yml index db3f550b96..3f365f5ebb 100644 --- a/.pipelines/templates/release-validate-sdk.yml +++ b/.pipelines/templates/release-validate-sdk.yml @@ -95,7 +95,7 @@ jobs: "@ - $releaseVersion = '$(Version)' + $releaseVersion = '$(OutputVersion.Version)' Write-Verbose -Message "Release Version: $releaseVersion" -Verbose