dotnet-installer/build/publish/PublishContent.targets
John Beisner 8649a5c6c2
Orchestrated final publish; CLI:master (#8504)
* Orchestrated final publish: https://github.com/dotnet/core-eng/issues/2407

* Changes per code review...
2018-01-30 15:22:32 -08:00

61 lines
3.2 KiB
XML

<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OverwriteOnPublish Condition="'$(OverwriteOnPublish)' == ''">false</OverwriteOnPublish>
</PropertyGroup>
<!-- gathers the items to be published -->
<Target Name="GatherItemsForPattern">
<Error Condition="'$(PublishPattern)' == ''" Text="Please specify a value for PublishPattern using standard msbuild 'include' syntax." />
<ItemGroup>
<ForPublishing Include="$(PublishPattern)" />
</ItemGroup>
<!-- add relative blob path metadata -->
<ItemGroup>
<ForPublishing>
<RelativeBlobPath>$([System.String]::Copy('%(RecursiveDir)%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
<ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData>
</ForPublishing>
</ItemGroup>
<Error Condition="'@(ForPublishing)' == ''" Text="No items were found matching pattern '$(PublishPattern)'." />
</Target>
<!-- publishes artifacts to blob storage in Azure -->
<Target Name="UploadArtifactsToAzure" DependsOnTargets="GatherItemsForPattern">
<Error Condition="'$(ArtifactCloudDropAccessToken)' == ''" Text="Missing property ArtifactCloudDropAccessToken." />
<Error Condition="'$(ArtifactCloudDropURL)' == ''" Text="Missing property ArtifactCloudDropURL." />
<Message Text="Publish assets to blob storage started: $(ArtifactCloudDropURL)" />
<PushToBlobFeed ExpectedFeedUrl="$(ArtifactCloudDropURL)"
AccountKey="$(ArtifactCloudDropAccessToken)"
ItemsToPush="@(ForPublishing)"
ManifestBranch="$(BranchName)"
ManifestBuildId="$(FullNugetVersion)"
ManifestCommit="$(CommitHash)"
ManifestName="$(BuildName)"
ManifestBuildData="ProductVersion=$(FullNugetVersion)"
Overwrite="$(OverwriteOnPublish)"
PublishFlatContainer="true"
SkipCreateManifest="$(IsNotOrchestratedPublish)" />
</Target>
<!-- publishes checksums for the artifacts to blob storage in Azure -->
<Target Name="UploadChecksumsToAzure" DependsOnTargets="GenerateChecksums">
<Error Condition="'$(ChecksumCloudDropAccessToken)' == ''" Text="Missing property ChecksumCloudDropAccessToken." />
<Error Condition="'$(ChecksumCloudDropURL)' == ''" Text="Missing property ChecksumCloudDropURL." />
<Message Text="Publish checksums to blob storage started: $(ChecksumCloudDropURL)" />
<PushToBlobFeed ExpectedFeedUrl="$(ChecksumCloudDropURL)"
AccountKey="$(ChecksumCloudDropAccessToken)"
ItemsToPush="@(ArtifactsForGeneratingChecksums->'%(DestinationPath)')"
ManifestBranch="$(BranchName)"
ManifestBuildId="$(FullNugetVersion)"
ManifestCommit="$(CommitHash)"
ManifestName="$(BuildName)"
ManifestBuildData="ProductVersion=$(FullNugetVersion)"
Overwrite="$(OverwriteOnPublish)"
PublishFlatContainer="true"
SkipCreateManifest="$(IsNotOrchestratedPublish)" />
</Target>
</Project>