Merge pull request #6103 from livarcocc/fix_publishing

Fix publishing
This commit is contained in:
Livar 2020-01-09 14:14:45 -08:00 committed by GitHub
commit 1e9e86e0d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 16 deletions

View file

@ -16,6 +16,8 @@
<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
that exists in the container. Disambiguate the manifests via available properties.
@ -53,6 +55,7 @@
<Target Name="PublishSdkAssetsAndChecksums"
BeforeTargets="Publish"
DependsOnTargets="GenerateFullNuGetVersion"
Condition=" '$(PublishSdkAssetsAndChecksumsToBlob)' == 'true' ">
<!-- If the sdk version is stabilized, then we should double publish the binaries to suffixed file names.

View file

@ -8,7 +8,7 @@
<Import Project="targets\BranchInfo.props" />
<Import Project="..\redist\targets\BuildCoreSdkTasks.targets" />
<Import Project="..\redist\targets\GetRuntimeInformation.targets" />
<Import Project="..\redist\targets\SetBuildDefaults.targets" />
<Import Project="..\redist\targets\Versions.targets" />
<Import Project="targets\FinishBuild.targets" />
</Project>

View file

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="FinalizeBuild"
BeforeTargets="AfterBuild">
BeforeTargets="AfterBuild"
DependsOnTargets="GenerateFullNuGetVersion;GetCommitHash">
<CopyBlobsToLatest FeedUrl="$(DotnetPublishSdkAssetsBlobFeedUrl)"
AccountKey="$(DotNetPublishSdkAssetsBlobFeedKey)"
NugetVersion="$(FullNugetVersion)"

View file

@ -22,6 +22,7 @@
<Import Project="targets\BuildCoreSdkTasks.targets" />
<Import Project="targets\GetRuntimeInformation.targets" />
<Import Project="targets\SetBuildDefaults.targets" />
<Import Project="targets\Versions.targets" />
<Import Project="targets\Branding.targets" />
<Import Project="targets\BundledTemplates.targets" />
<Import Project="targets\BundledDotnetTools.targets" />

View file

@ -414,25 +414,12 @@
ReplacementStrings="$(ReplacementString)" />
</Target>
<Target Name="GenerateVersionFile" DependsOnTargets="SetupBundledComponents">
<Exec Command="git rev-parse HEAD"
ConsoleToMSBuild="true"
Condition=" '$(GitCommitHash)' == '' ">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHash" />
</Exec>
<Target Name="GenerateVersionFile" DependsOnTargets="SetupBundledComponents;GetCommitHash">
<WriteLinesToFile File="$(SdkOutputDirectory).version"
Lines="$(GitCommitHash);$(Version);$(Rid)"
Overwrite="true" />
</Target>
<Target Name="GenerateFullNuGetVersion">
<PropertyGroup>
<FullNugetVersion>$(VersionPrefix)-$(PreReleaseVersionLabel).$(PreReleaseVersionIteration)</FullNugetVersion>
<FullNugetVersion Condition=" '$(VersionSuffixDateStamp)' != '' And '$(VersionSuffixBuildOfTheDay)' != '' ">$(FullNugetVersion).$(VersionSuffixDateStamp).$(VersionSuffixBuildOfTheDay)</FullNugetVersion>
</PropertyGroup>
</Target>
<Target Name="LayoutAppHostTemplate" DependsOnTargets="RunResolvePackageDependencies">
<PropertyGroup>

View file

@ -0,0 +1,16 @@
<Project>
<Target Name="GenerateFullNuGetVersion">
<PropertyGroup>
<FullNugetVersion>$(VersionPrefix)-$(PreReleaseVersionLabel).$(PreReleaseVersionIteration)</FullNugetVersion>
<FullNugetVersion Condition=" '$(VersionSuffixDateStamp)' != '' And '$(VersionSuffixBuildOfTheDay)' != '' ">$(FullNugetVersion).$(VersionSuffixDateStamp).$(VersionSuffixBuildOfTheDay)</FullNugetVersion>
</PropertyGroup>
</Target>
<Target Name="GetCommitHash">
<Exec Command="git rev-parse HEAD"
ConsoleToMSBuild="true"
Condition=" '$(GitCommitHash)' == '' ">
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommitHash" />
</Exec>
</Target>
</Project>