Did a hack where we are writing the version to a file during build to be read during publish, as these are two separate builds by arcade and also passed the BuildNumberId so that the id is calculated properly during copy to latest.

This commit is contained in:
Livar Cunha 2020-01-09 21:13:46 -08:00
parent 3d19fb27a2
commit 688644d44e
3 changed files with 14 additions and 4 deletions

View file

@ -236,6 +236,7 @@ stages:
- group: DotNet-DotNetCli-Storage
steps:
- script: eng/CopyToLatest.cmd
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:DotnetPublishSdkAssetsBlobFeedUrl=https://dotnetcli.blob.core.windows.net/dotnet/index.json
/p:DotNetPublishSdkAssetsBlobFeedKey=$(dotnetcli-storage-key)
/p:DotnetPublishChecksumsBlobFeedUrl=https://dotnetclichecksums.blob.core.windows.net/dotnet/index.json

View file

@ -15,8 +15,6 @@
</PropertyGroup>
<Import Project="$(NuGetPackageRoot)microsoft.dotnet.build.tasks.feed\$(MicrosoftDotNetBuildTasksFeedVersion)\build\Microsoft.DotNet.Build.Tasks.Feed.targets" Condition=" '$(PublishSdkAssetsAndChecksumsToBlob)' == 'true' " />
<Import Project="..\src\redist\targets\Versions.targets" />
<PropertyGroup>
<!-- Because we may be building in a container, we should use an asset manifest file path
@ -55,9 +53,14 @@
<Target Name="PublishSdkAssetsAndChecksums"
BeforeTargets="Publish"
DependsOnTargets="GenerateFullNuGetVersion"
Condition=" '$(PublishSdkAssetsAndChecksumsToBlob)' == 'true' ">
<ReadLinesFromFile File="$(ArtifactsTmpDir)FullNugetVersion.version">
<Output
TaskParameter="Lines"
PropertyName="FullNugetVersion"/>
</ReadLinesFromFile>
<!-- If the sdk version is stabilized, then we should double publish the binaries to suffixed file names.
To do this, create new copies of the blobs, replacing the SdkVersion string in the file name with the
FullNugetVersion, except if the FullNuGetVersion is already in the file name (which would end up

View file

@ -414,10 +414,16 @@
ReplacementStrings="$(ReplacementString)" />
</Target>
<Target Name="GenerateVersionFile" DependsOnTargets="SetupBundledComponents;GetCommitHash">
<Target Name="GenerateVersionFile"
DependsOnTargets="SetupBundledComponents;GetCommitHash;GenerateFullNuGetVersion">
<WriteLinesToFile File="$(SdkOutputDirectory).version"
Lines="$(GitCommitHash);$(Version);$(Rid)"
Overwrite="true" />
<!-- This is a hack to make the full nuget version available during the publishing step -->
<WriteLinesToFile File="$(ArtifactsTmpDir)FullNugetVersion.version"
Lines="$(FullNugetVersion)"
Overwrite="true" />
</Target>
<Target Name="LayoutAppHostTemplate" DependsOnTargets="RunResolvePackageDependencies">