diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 8f70c85bfd..5bc7d5a116 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -682,7 +682,7 @@ extends: condition: and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}')), succeeded()) dependsOn: build jobs: - - job: vs_marketplace + - deployment: vs_marketplace pool: name: Azure-Pipelines-1ESPT-ExDShared os: linux @@ -699,37 +699,39 @@ extends: targetPath: "$(Pipeline.Workspace)" dependsOn: - github_release - steps: - - download: none - - task: NodeTool@0 - inputs: - versionSpec: "18.x" - - pwsh: npm i -g @vscode/vsce - - pwsh: $(Pipeline.Workspace)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} - displayName: "Set version suffix" - - task: AzureCLI@2 - inputs: - azureSubscription: "kiota-vscode-marketplace-publish" - scriptType: "pscore" - scriptLocation: "inlineScript" - inlineScript: | - $aadToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv - Get-ChildItem -Path $(Pipeline.Workspace) -Filter *.vsix -Recurse | ForEach-Object { - $packagePath = $_.FullName - $manifestPath = $packagePath.Replace("vsix", "manifest") - $signaturePath = $packagePath.Replace("vsix", "signature.p7s") - Write-Host "Publishing $packagePath" - if ($Env:isPrerelease -eq "true") { - Write-Host "Publishing $packagePath as a pre-release" - vsce publish --pat "$aadToken" --packagePath $packagePath --manifestPath $manifestPath --signaturePath $signaturePath --pre-release - } - else { - Write-Host "Publishing $packagePath as a release" - vsce publish --pat "$aadToken" --packagePath $packagePath --manifestPath $manifestPath --signaturePath $signaturePath - } - } - env: - isPrerelease: $(isPrerelease) + strategy: + runOnce: + deploy: + steps: + - task: NodeTool@0 + inputs: + versionSpec: "18.x" + - pwsh: npm i -g @vscode/vsce + - pwsh: $(Pipeline.Workspace)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} + displayName: "Set version suffix" + - task: AzureCLI@2 + inputs: + azureSubscription: "kiota-vscode-marketplace-publish" + scriptType: "pscore" + scriptLocation: "inlineScript" + inlineScript: | + $aadToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv + Get-ChildItem -Path $(Pipeline.Workspace) -Filter *.vsix -Recurse | ForEach-Object { + $packagePath = $_.FullName + $manifestPath = $packagePath.Replace("vsix", "manifest") + $signaturePath = $packagePath.Replace("vsix", "signature.p7s") + Write-Host "Publishing $packagePath" + if ($Env:isPrerelease -eq "true") { + Write-Host "Publishing $packagePath as a pre-release" + vsce publish --pat "$aadToken" --packagePath $packagePath --manifestPath $manifestPath --signaturePath $signaturePath --pre-release + } + else { + Write-Host "Publishing $packagePath as a release" + vsce publish --pat "$aadToken" --packagePath $packagePath --manifestPath $manifestPath --signaturePath $signaturePath + } + } + env: + isPrerelease: $(isPrerelease) - deployment: github_release pool: name: Azure-Pipelines-1ESPT-ExDShared @@ -763,7 +765,6 @@ extends: runOnce: deploy: steps: - - download: none - pwsh: $(Pipeline.Workspace)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} displayName: "Set version suffix" - pwsh: $(Pipeline.Workspace)/scripts/get-version-from-csproj.ps1 -csprojPath "$(Pipeline.Workspace)/csproj/kiota.csproj" @@ -824,7 +825,6 @@ extends: runOnce: deploy: steps: - - download: none - powershell: | Remove-Item "$(Pipeline.Workspace)/Microsoft.OpenApi.Kiota.Builder.*.nupkg" -Verbose displayName: remove other nupkgs to avoid duplication @@ -854,7 +854,6 @@ extends: runOnce: deploy: steps: - - download: none - powershell: | Remove-Item "$(Pipeline.Workspace)/Microsoft.OpenApi.Kiota.*.nupkg" -Verbose -Exclude "*.Builder.*" displayName: remove other nupkgs to avoid duplication