-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathPublishing.props
134 lines (114 loc) · 6.8 KB
/
Publishing.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>
<PropertyGroup>
<PublishingVersion>3</PublishingVersion>
<!-- This repo does its own symbol package generation to avoid generating symbols for a bunch of unrelated test packages. -->
<AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
</PropertyGroup>
<PropertyGroup>
<Product>Sdk</Product>
<BlobStoragePartialRelativePath>$(Product)</BlobStoragePartialRelativePath>
<BlobStoragePartialRelativePath Condition="'$(IsNotOrchestratedPublish)' == 'false'">assets/$(Product)</BlobStoragePartialRelativePath>
<SdkAssetManifestFileName>$(OS)-$(PlatformName)-SdkAssets.xml</SdkAssetManifestFileName>
<SdkAssetsManifestFilePath>$(ArtifactsLogDir)AssetManifest\$(SdkAssetManifestFileName)</SdkAssetsManifestFilePath>
<TempWorkingDirectory>$(ArtifactsDir)\..\AssetsTmpDir\$([System.Guid]::NewGuid())</TempWorkingDirectory>
</PropertyGroup>
<!-- Pulled from arcade's publish.proj see https://github.com/dotnet/arcade/issues/5790 for
issue on making this common in arcade so it doesn't have to be duplicated here -->
<PropertyGroup>
<CollectionUri>$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)</CollectionUri>
<!-- When we have dev.azure.com/<account>/ -->
<AzureDevOpsAccount Condition="$(CollectionUri.IndexOf('dev.azure.com')) >= 0">$(CollectionUri.Split('/')[3])</AzureDevOpsAccount>
<!-- When we have <account>.visualstudio.com -->
<AzureDevOpsAccount Condition="$(CollectionUri.IndexOf('visualstudio.com')) >= 0">$(CollectionUri.Split('.')[0].Split('/')[2])</AzureDevOpsAccount>
</PropertyGroup>
<!--
The new Maestro/BAR build model keeps separate Azure DevOps and GitHub build information.
The GitHub information will be extracted based on the Azure DevOps repository.
-->
<ItemGroup>
<ManifestBuildData Include="InitialAssetsLocation=$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$(SYSTEM_TEAMPROJECT)/_apis/build/builds/$(BUILD_BUILDID)/artifacts" />
<ManifestBuildData Include="AzureDevOpsBuildId=$(BUILD_BUILDID)" />
<ManifestBuildData Include="AzureDevOpsBuildDefinitionId=$(SYSTEM_DEFINITIONID)" />
<ManifestBuildData Include="AzureDevOpsAccount=$(AzureDevOpsAccount)" />
<ManifestBuildData Include="AzureDevOpsProject=$(SYSTEM_TEAMPROJECT)" />
<ManifestBuildData Include="AzureDevOpsBuildNumber=$(BUILD_BUILDNUMBER)" />
<ManifestBuildData Include="AzureDevOpsRepository=$(BUILD_REPOSITORY_URI)" />
<ManifestBuildData Include="AzureDevOpsBranch=$(BUILD_SOURCEBRANCH)" />
</ItemGroup>
<ItemGroup>
<ToolsetAssetsToPublish Include="$(ArtifactsNonShippingPackagesDir)*.zip" />
</ItemGroup>
<Target Name="ReadToolsetVersion">
<ReadLinesFromFile File="$(ArtifactsBinDir)version.txt">
<Output TaskParameter="Lines" ItemName="ToolsetVersion"/>
</ReadLinesFromFile>
<CreateProperty Value="@(ToolsetVersion)">
<Output TaskParameter="Value" PropertyName="ToolsetVersionValue" />
</CreateProperty>
</Target>
<!-- FSharp needs to push different packages to nuget.org depending on whether the SDK is preview or not,
To achieve this, we find the FSharp compiler package, then the stable or non-stable FSharp.Core and Compiler service
package contained within, depending on the stability switch of the SDK. The SDK then treats these packages as its own outputs,
whch means they get automatically pushed on release day. -->
<PropertyGroup>
<PublishDependsOnTargets>$(PublishDependsOnTargets);_ResolvePublishFSharpNuGetPackages</PublishDependsOnTargets>
</PropertyGroup>
<Target Name="_ResolvePublishFSharpNuGetPackages">
<PropertyGroup>
<FSharpCorePath Condition="'$(DotNetFinalVersionKind)'!='release'">Shipping</FSharpCorePath>
<FSharpCorePath Condition="'$(DotNetFinalVersionKind)'=='release'">Release</FSharpCorePath>
</PropertyGroup>
<ItemGroup>
<FSharpPackagesToPush Include="$(NuGetPackageRoot)\Microsoft.FSharp.Compiler\$(MicrosoftFSharpCompilerPackageVersion)\contentFiles\$(FSharpCorePath)\FSharp.Core.*.nupkg"/>
<FSharpPackagesToPush Include="$(NuGetPackageRoot)\Microsoft.FSharp.Compiler\$(MicrosoftFSharpCompilerPackageVersion)\contentFiles\$(FSharpCorePath)\FSharp.Compiler.Service.*.nupkg" />
<ItemsToPushToBlobFeed Include="@(FSharpPackagesToPush)" />
</ItemGroup>
</Target>
<!-- We use a separate target to publish this to blob storage so that we can push this to
a relative path inside the blob storage. -->
<Target Name="PublishToolsetAssets" DependsOnTargets="ReadToolsetVersion" BeforeTargets="Publish">
<ItemGroup>
<ToolsetAssetsToPushToBlobFeed Include="@(ToolsetAssetsToPublish)">
<RelativeBlobPath>$(BlobStoragePartialRelativePath)/$(ToolsetVersionValue)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
<ManifestArtifactData>NonShipping=true</ManifestArtifactData>
</ToolsetAssetsToPushToBlobFeed>
</ItemGroup>
<ItemGroup Condition="'$(PostBuildSign)' == 'true'">
<ItemsToSignPostBuild Remove="@(ItemsToSignPostBuild)" />
<ItemsToSignPostBuild Include="@(ToolsetAssetsToPublish->'%(Filename)%(Extension)')" />
</ItemGroup>
<PropertyGroup>
<IsStableBuild>false</IsStableBuild>
<IsStableBuild Condition="'$(DotNetFinalVersionKind)' == 'release'">true</IsStableBuild>
</PropertyGroup>
<MakeDir Directories="$(TempWorkingDirectory)"/>
<PushToAzureDevOpsArtifacts
AzureDevOpsCollectionUri="$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)"
AzureDevOpsProject="$(SYSTEM_TEAMPROJECT)"
AzureDevOpsBuildId="$(BUILD_BUILDID)"
ItemsToPush="@(ToolsetAssetsToPushToBlobFeed)"
ItemsToSign="@(ItemsToSignPostBuild)"
CertificatesSignInfo="@(CertificatesSignInfo)"
StrongNameSignInfo="@(StrongNameSignInfo)"
FileSignInfo="@(FileSignInfo)"
FileExtensionSignInfo="@(FileExtensionSignInfo)"
ManifestBuildData="@(ManifestBuildData)"
ManifestRepoUri="$(BUILD_REPOSITORY_NAME)"
ManifestBranch="$(BUILD_SOURCEBRANCH)"
ManifestBuildId="$(BUILD_BUILDNUMBER)"
ManifestCommit="$(BUILD_SOURCEVERSION)"
PublishFlatContainer="true"
AssetManifestPath="$(SdkAssetsManifestFilePath)"
AssetsTemporaryDirectory="$(TempWorkingDirectory)"
PublishingVersion="3"
IsStableBuild="$(IsStableBuild)" />
<Copy
SourceFiles="$(SdkAssetsManifestFilePath)"
DestinationFolder="$(TempWorkingDirectory)\$(SdkAssetManifestFileName)" />
<Message
Text="##vso[artifact.upload containerfolder=AssetManifests;artifactname=AssetManifests]$(TempWorkingDirectory)/$(SdkAssetManifestFileName)"
Importance="high" />
</Target>
</Project>