Publish VS workloads assets in requested folder layout to BAR (#57559)
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Tue, 17 Aug 2021 18:08:38 +0000 (20:08 +0200)
committerGitHub <noreply@github.com>
Tue, 17 Aug 2021 18:08:38 +0000 (20:08 +0200)
See discussion in https://github.com/dotnet/runtime/issues/57154

eng/pipelines/common/upload-intermediate-artifacts-step.yml
eng/pipelines/mono/templates/workloads-build.yml
src/installer/prepare-artifacts.proj

index 2633da6..bde6c61 100644 (file)
@@ -1,6 +1,7 @@
 parameters:
   name: ''
   publishPackagesCondition: always()
+  publishVSSetupCondition: false
 
 steps:
 - task: CopyFiles@2
@@ -14,6 +15,16 @@ steps:
     TargetFolder: '$(Build.StagingDirectory)/IntermediateArtifacts/${{ parameters.name }}'
     CleanTargetFolder: true
 
+- task: CopyFiles@2
+  displayName: Prepare job-specific intermediate artifacts subdirectory
+  condition: and(succeeded(), ${{ parameters.publishVSSetupCondition }})
+  inputs:
+    SourceFolder: '$(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)'
+    Contents: |
+      Insertion/**/*
+    TargetFolder: '$(Build.StagingDirectory)/IntermediateArtifacts/${{ parameters.name }}'
+    CleanTargetFolder: true
+
 - task: PublishBuildArtifacts@1
   displayName: Publish intermediate artifacts
   inputs:
index 65fcbd5..a6b6e75 100644 (file)
@@ -91,10 +91,8 @@ jobs:
         Contents: '*.wixpdb'
 
     # Upload artifacts to be used for generating VS components
-    - task: PublishPipelineArtifact@1
-      displayName: Publish workload artifacts
-      inputs:
-        targetPath: $(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)/Insertion
-        artifactName: 'Insertion'
-      continueOnError: true
-      condition: always()
+    - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
+      parameters:
+        name: workloads-vs
+        publishPackagesCondition: false
+        publishVSSetupCondition: true
index 74c44fe..159125b 100644 (file)
         <PublishFlatContainer>true</PublishFlatContainer>
       </ItemsToPush>
 
+      <ItemsToPush Include="@(WorkloadsVSInsertionFile)">
+        <RelativeBlobPath>$(InstallersRelativePath)workloads/$(SdkBandVersion)/%(Filename)%(Extension)</RelativeBlobPath>
+        <PublishFlatContainer>true</PublishFlatContainer>
+      </ItemsToPush>
     </ItemGroup>
 
     <!-- Push items to AzDO as build artifacts, generating the asset manifest as a side effect. -->
 
       <DownloadedSymbolNupkgFile Include="$(DownloadDirectory)**\*.symbols.nupkg" />
       <DownloadedWixPdbFile Include="$(DownloadDirectory)**\*.wixpdb" />
+      <DownloadedWorkloadsVSInsertionFile Include="$(DownloadDirectory)*\workloads-vs\**\*" />
       <DownloadedNupkgFile
         Include="$(DownloadDirectory)**\*.nupkg"
         Exclude="@(DownloadedSymbolNupkgFile)" />
       <!-- Add files that are not affected by filtering. -->
       <UploadToBlobStorageFile
         Include="@(DownloadedArtifactFile)"
-        Exclude="@(DownloadedSymbolNupkgFile);@(DownloadedNupkgFile);@(DownloadedWixPdbFile)" />
+        Exclude="@(DownloadedSymbolNupkgFile);@(DownloadedNupkgFile);@(DownloadedWixPdbFile);@(DownloadedWorkloadsVSInsertionFile)" />
 
       <!--
         Filter out the RID-specific (Runtime) nupkgs and RID-agnostic nupkgs. RID-specific packages
         Include="$(DownloadDirectory)**\VS.Redist.Common.*.nupkg"
         Exclude="@(DownloadedSymbolNupkgFile)" />
 
+      <!-- Workloads VS insertion artifacts produced by src/workloads/workloads.csproj -->
+      <WorkloadsVSInsertionFile
+        Include="
+          $(DownloadDirectory)*\workloads-vs\**\*.json;
+          $(DownloadDirectory)*\workloads-vs\**\*.msi" />
+
       <!--
         Runtime packages associated with some identity packages. Need to exclude "runtime.native.*"
         because Libraries produces some "runtime.native.Foo" packages with