Set azure devops variable if any package reports are found and skip copy packages...
authorSantiago Fernandez Madero <safern@microsoft.com>
Tue, 11 Feb 2020 02:18:09 +0000 (18:18 -0800)
committerGitHub <noreply@github.com>
Tue, 11 Feb 2020 02:18:09 +0000 (18:18 -0800)
* Set azure devops variable if any package reports are found

* Run target in CI as well

eng/pipelines/libraries/build-job.yml
src/libraries/packages.builds

index 346be74..4f95464 100644 (file)
@@ -153,7 +153,8 @@ jobs:
             inputs:
               sourceFolder: $(Build.SourcesDirectory)/artifacts/packages
               targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/packages
-          
+            condition: and(succeeded(), eq(variables['_librariesBuildProducedPackages'], true))
+
           - task: CopyFiles@2
             displayName: Prepare tmp assets to publish
             inputs:
index aac3972..512fc94 100644 (file)
   </Target>
 
   <Import Project="$(MSBuildThisFileDirectory)dir.traversal.targets" />
+
+  <Target Name="SetAzureDevOpsVariableForBuiltPackages"
+          Condition="'$(ContinuousIntegrationBuild)' == 'true'"
+          AfterTargets="BuildAllProjects">
+    <ItemGroup>
+      <_PackageReports Include="$(PackageReportDir)*.json" />
+    </ItemGroup>
+
+    <Message Condition="'@(_PackageReports)' != ''" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
+  </Target>
 </Project>