Skip to content

Commit 1e2c6ac

Browse files
authored
Deduplidate assets in VMR builds (#60792)
1 parent 1312da2 commit 1e2c6ac

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

eng/Publishing.props

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@
1212
'$(PostBuildSign)' != 'true' and
1313
'$(DotNetBuildRepo)' != 'true'">false</EnableDefaultArtifacts>
1414

15-
<PublishInstallerBaseVersion Condition="'$(PublishInstallerBaseVersion)' == '' and
16-
('$(OS)' == 'Windows_NT' or '$(DotNetBuildOrchestrator)' == 'true')">true</PublishInstallerBaseVersion>
1715
<!-- This avoids creating VS.*.symbols.nupkg packages that are identical to the original package. -->
1816
<AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
17+
<!--
18+
Some assets are produced in all jobs, but only one job can publish them. We follow the following rules in that case:
19+
- If we're building outside of the VMR, publish these assets from the Windows job.
20+
- If we're building inside the VMR, publish these assets from whichever job is producing non-RID-specific artifacts.
21+
-->
22+
<PublishAllBuildsAssetsInThisJob Condition="('$(OS)' == 'Windows_NT' and '$(DotNetBuildOrchestrator)' != 'true')
23+
or ('$(DotNetBuildOrchestrator)' == 'true' and '$(EnableDefaultRidSpecificArtifacts)' != 'true'
24+
and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1'))">true</PublishAllBuildsAssetsInThisJob>
25+
<PublishInstallerBaseVersion Condition="'$(PublishInstallerBaseVersion)' == ''">$(PublishAllBuildsAssetsInThisJob)</PublishInstallerBaseVersion>
1926
</PropertyGroup>
2027

2128
<!-- $(InstallersOutputPath), $(SymbolsOutputPath), and $(ChecksumExtensions) are not defined. Root Directory.Build.props is not imported. -->
@@ -24,10 +31,10 @@
2431
<FilesToPublishToSymbolServer Include="$(ArtifactsDir)symbols\**\*.pdb" />
2532

2633
<!-- Prepare for _PublishInstallersAndChecksums target. -->
27-
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.jar" UploadPathSegment="jar" />
28-
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.pom" UploadPathSegment="jar" />
34+
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.jar" UploadPathSegment="jar" Condition="'$(PublishAllBuildsAssetsInThisJob)' == 'true'" />
35+
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.pom" UploadPathSegment="jar" Condition="'$(PublishAllBuildsAssetsInThisJob)' == 'true'" />
2936
<!-- All builds produce npm assets - only publish them once -->
30-
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.tgz" UploadPathSegment="npm" Condition="'$(OS)' == 'Windows_NT' or '$(DotNetBuildOrchestrator)' == 'true'" />
37+
<_InstallersToPublish Include="$(ArtifactsDir)packages\**\*.tgz" UploadPathSegment="npm" Condition="'$(PublishAllBuildsAssetsInThisJob)' == 'true'" />
3138
<_InstallersToPublish Include="$(ArtifactsDir)installers\**\*.version" UploadPathSegment="Runtime" Condition="'$(PublishInstallerBaseVersion)' == 'true'" />
3239

3340
<!-- The following installers create checksums -->

0 commit comments

Comments
 (0)