Skip to content

Commit

Permalink
Publish packages for PR val builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed Apr 6, 2023
1 parent 2833fe8 commit 8eddd08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines-pr-validation.yml
Expand Up @@ -152,7 +152,7 @@ stages:
displayName: Publish Assets
inputs:
filePath: 'eng\publish-assets.ps1'
arguments: '-configuration $(BuildConfiguration) -branchName "$(SourceBranchName)"'
arguments: '-configuration $(BuildConfiguration) -branchName "$(SourceBranchName)" -prValidation'
condition: succeeded()

# Publish OptProf generated JSON files as a build artifact. This allows for easy inspection from
Expand Down
3 changes: 2 additions & 1 deletion eng/config/PublishData.json
@@ -1,7 +1,8 @@
{
"feeds": {
"vssdk": "https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json",
"vs-impl": "https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json"
"vs-impl": "https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json",
"vs": "https://pkgs.dev.azure.com/DevDiv/_packaging/VS/nuget/v3/index.json"
},
"packages": {
"default": {
Expand Down
13 changes: 6 additions & 7 deletions eng/publish-assets.ps1
Expand Up @@ -13,6 +13,7 @@ Param(
[string]$branchName = "",
[string]$releaseName = "",
[switch]$test,
[switch]$prValidation,

# Credentials
[string]$nugetApiKey = ""
Expand Down Expand Up @@ -44,7 +45,7 @@ function Publish-Nuget($publishData, [string]$packageDir) {
}

# If the configured packageFeeds is arcade, then skip publishing here. Arcade will handle publishing packages to their feeds.
if ($packageFeeds.equals("arcade")) {
if ($packageFeeds.equals("arcade") -and -not $prValidation) {
Write-Host " Skipping publishing for all packages as they will be published by arcade"
continue
}
Expand All @@ -55,12 +56,6 @@ function Publish-Nuget($publishData, [string]$packageDir) {
$packageFeeds = $publishData.packageFeeds
}

# If the configured packageFeeds is arcade, then skip publishing here. Arcade will handle publishing packages to their feeds.
if ($packageFeeds.equals("arcade")) {
Write-Host " Skipping publishing for all packages as they will be published by arcade"
continue
}

# Each branch stores the name of the package to feed map it should use.
# Retrieve the correct map for this particular branch.
$packagesData = GetPackagesPublishData $packageFeeds
Expand All @@ -87,6 +82,10 @@ function Publish-Nuget($publishData, [string]$packageDir) {

$feedName = $packagesData.$nupkgWithoutVersion

if ($prValidation) {
$feedName = "vs"
}

# If the configured feed is arcade, then skip publishing here. Arcade will handle publishing to their feeds.
if ($feedName.equals("arcade")) {
Write-Host "Skipping publishing for $nupkg as it is published by arcade"
Expand Down

0 comments on commit 8eddd08

Please sign in to comment.