[release/5.0.1xx-preview4] Generate versions sparsely (#7290)

* Publish productVersion sparsely
Do not publish the productVersion file in every leg. Publish only in win-x64,
so that we don't end up uploading it for every manifest. Publishing breaks in this scenario today.
This is a real bug in publishing, but we will probably tighten the restrictions in the
Publish to BAR step so that multi-publishign the same asset is an error.

Also remove the productCommit-* in cases where we have overlapping rids, which would cause the same problem
This commit is contained in:
Matt Mitchell 2020-04-24 14:02:27 -07:00 committed by Sarah Oslund
parent 4b8d2d12f1
commit 3c6fe698ef
2 changed files with 6 additions and 2 deletions

View file

@ -42,11 +42,15 @@
<SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)*.nupkg" /> <SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)*.nupkg" />
<SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)*.cab" /> <SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)*.cab" />
<SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)*.svg" Condition=" '$(PublishBinariesAndBadge)' == 'true' " /> <SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)*.svg" Condition=" '$(PublishBinariesAndBadge)' == 'true' " />
<SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)productVersion.txt" Condition=" '$(PublishBinariesAndBadge)' == 'true' " /> <!-- Only publish this file from windows x64 so that we don't end up with duplicates -->
<SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)productVersion.txt"
Condition=" '$(PublishBinariesAndBadge)' == 'true' and '$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64'" />
<SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)productCommit-*.txt" Condition=" '$(PublishBinariesAndBadge)' == 'true' " /> <SdkAssetsToPublish Include="$(ArtifactsShippingPackagesDir)productCommit-*.txt" Condition=" '$(PublishBinariesAndBadge)' == 'true' " />
<SdkNonShippingAssetsToPublish Include="$(ArtifactsNonShippingPackagesDir)*.nupkg" /> <SdkNonShippingAssetsToPublish Include="$(ArtifactsNonShippingPackagesDir)*.nupkg" />
<SdkNonShippingAssetsToPublish Include="$(ArtifactsNonShippingPackagesDir)*.swr" /> <SdkNonShippingAssetsToPublish Include="$(ArtifactsNonShippingPackagesDir)*.swr" />
<CheckSumsToPublish Include="$(ArtifactsShippingPackagesDir)*.sha" /> <CheckSumsToPublish Include="$(ArtifactsShippingPackagesDir)*.sha" />
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)productCommit-*.txt.sha" Condition=" '$(PublishBinariesAndBadge)' == 'false'" />
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)productVersion.txt.sha" Condition=" '$(OS)' != 'Windows_NT' or '$(Architecture)' != 'x64'" />
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)*.zip.sha" Condition=" '$(PublishBinariesAndBadge)' == 'false' "/> <CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)*.zip.sha" Condition=" '$(PublishBinariesAndBadge)' == 'false' "/>
<CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)*.tar.gz.sha" Condition=" '$(PublishBinariesAndBadge)' == 'false' "/> <CheckSumsToPublish Remove="$(ArtifactsShippingPackagesDir)*.tar.gz.sha" Condition=" '$(PublishBinariesAndBadge)' == 'false' "/>
</ItemGroup> </ItemGroup>

View file

@ -7,7 +7,7 @@
File="$(ArtifactsShippingPackagesDir)productVersion.txt" File="$(ArtifactsShippingPackagesDir)productVersion.txt"
Lines="$(PackageVersion)" Lines="$(PackageVersion)"
Overwrite="true" Overwrite="true"
Encoding="ASCII"/> Encoding="ASCII" />
<WriteLinesToFile <WriteLinesToFile
File="$(ArtifactsShippingPackagesDir)productCommit-$(Rid).txt" File="$(ArtifactsShippingPackagesDir)productCommit-$(Rid).txt"