dotnet-installer/build/Publish.targets

99 lines
5.2 KiB
Text
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(NuGetPackagesDir)/microsoft.dotnet.build.tasks.feed/$(BuildTasksFeedToolVersion)/build/Microsoft.DotNet.Build.Tasks.Feed.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/FinishBuild.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/PublishContent.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/PublishNupkgToBlobFeed.targets" />
2017-02-14 23:42:13 +00:00
<Import Project="$(MSBuildThisFileDirectory)/publish/Badge.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/Checksum.targets" />
<Import Project="$(MSBuildThisFileDirectory)/publish/RuntimeCoherence.targets" />
<!-- PUBLISH_TO_AZURE_BLOB env variable set by CI -->
<Target Name="Publish"
Condition=" '$(PUBLISH_TO_AZURE_BLOB)' == 'true' "
2016-07-15 20:44:11 +00:00
DependsOnTargets="Init;
SetBadgeProps;
Package;
2017-07-06 18:11:07 +00:00
EvaluateRuntimeCoherence;
PublishArtifacts;
2016-07-15 20:44:11 +00:00
FinishBuild" />
<Target Name="PublishWithoutPackage"
Condition=" '$(PUBLISH_TO_AZURE_BLOB)' == 'true' "
2016-07-15 20:44:11 +00:00
DependsOnTargets="Init;
SetBadgeProps;
2017-07-06 18:11:07 +00:00
EvaluateRuntimeCoherence;
PublishArtifacts;
2016-07-15 20:44:11 +00:00
FinishBuild" />
<!-- UploadToAzure target comes from Build Tools -->
<Target Name="PublishArtifacts"
2017-06-30 19:17:20 +00:00
DependsOnTargets="GenerateVersionBadge;
GenerateCoherentBadge;
GatherItemsForPattern;
GenerateChecksums;
UploadArtifactsToAzure;
UploadChecksumsToAzure;
PublishNupkgToBlobFeed;
2017-07-03 21:34:04 +00:00
PublishCliVersionBadge" />
2017-08-30 23:16:08 +00:00
<Target Name="GatherItemsForPattern">
<ItemGroup>
<ForPublishing Include="@(GeneratedInstallers)"
Condition=" '$(PublishNativeInstallers)' == 'true' "/>
<ForPublishing Include="%(GenerateArchivesInputsOutputs.Outputs)"
Condition=" '$(PublishArchives)' == 'true' "/>
<ForPublishing Include="$(PackagesDirectory)/Microsoft.DotNet.Cli.Utils.*.nupkg"
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' " />
<ForPublishing Include="$(PackagesDirectory)/Microsoft.DotNet.MSBuildSdkResolver.*.nupkg"
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' " />
<ForPublishing Include="$(PackagesDirectory)/runtime.*.Microsoft.DotNet.SDK.*.symbols.nupkg" />
<ForPublishing Include="$(PackagesDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).*.nupkg"
Condition=" '$(OS)' == 'Windows_NT' "/>
<ForPublishing Include="$(PackagesDirectory)/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.*.nupkg"
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "/>
<ForPublishing Include="$(PackagesDirectory)/VS.Redist.Common.Net.Core.SDK.MSBuildExtensions.swr"
Condition=" '$(OS)' == 'Windows_NT' And '$(Architecture)' == 'x64' "/>
</ItemGroup>
<ItemGroup>
<ForPublishing>
<RelativeBlobPath>$(BlobStoragePartialRelativePath)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
<ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData>
</ForPublishing>
</ItemGroup>
</Target>
<Target Name="PublishCliVersionBadge">
<Error Condition="'$(ArtifactCloudDropAccessToken)' == ''" Text="Missing property ArtifactCloudDropAccessToken." />
<Error Condition="'$(ArtifactCloudDropURL)' == ''" Text="Missing property ArtifactCloudDropURL." />
<ItemGroup>
<CliVersionBadgeToUpload Include="$(VersionBadge)" />
2017-07-03 21:34:04 +00:00
<CliVersionBadgeToUpload Include="$(CoherentBadge)"
Condition=" '$(Coherent)' == 'true' And !$(Architecture.StartsWith('arm')) " />
</ItemGroup>
<ItemGroup>
<CliVersionBadgeToUpload>
<RelativeBlobPath>$(BlobStoragePartialRelativePath)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
<ManifestArtifactData>ShipInstaller=dotnetcli</ManifestArtifactData>
</CliVersionBadgeToUpload>
</ItemGroup>
<Message Text="Publish badges to blob feed started: $(ArtifactCloudDropURL)" />
<PushToBlobFeed ExpectedFeedUrl="$(ArtifactCloudDropURL)"
AccountKey="$(ArtifactCloudDropAccessToken)"
ItemsToPush="@(CliVersionBadgeToUpload)"
ManifestBranch="$(BranchName)"
ManifestBuildId="$(FullNugetVersion)"
ManifestCommit="$(CommitHash)"
ManifestName="$(BuildName)"
ManifestBuildData="ProductVersion=$(FullNugetVersion)"
Overwrite="false"
PublishFlatContainer="true"
SkipCreateManifest="$(IsNotOrchestratedPublish)" />
</Target>
</Project>