-
Notifications
You must be signed in to change notification settings - Fork 365
/
Copy pathPublish.proj
381 lines (326 loc) · 24.7 KB
/
Publish.proj
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project DefaultTargets="Publish">
<!--
Documentation for publishing is available here:
- https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Publishing.md
Optional variables:
DotNetFinalVersionKind Global property that stores the type of the current build: https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md#build-kind
DotNetSymbolServerTokenMsdl Personal access token for MSDL symbol server. Available from variable group DotNet-Symbol-Server-Pats.
DotNetSymbolServerTokenSymWeb Personal access token for SymWeb symbol server. Available from variable group DotNet-Symbol-Server-Pats.
DotNetSymbolExpirationInDays Symbol expiration time in days (defaults to 10 years).
SkipPackageChecks Skips package safety checks.
EnableDefaultArtifacts Includes packages under "/artifacts/packages/**" for publishing. Defaults to true.
DefaultArtifactVisibility The default visibility for Artifact items. Defaults to External.
EnableDefaultRidSpecificArtifacts Only externally publish packages for this build's TargetRid.
DotNetBuildPass While building the repo as part of the entire .NET stack, this parameter specifies which build pass the current build is part of.
The build pass number gets added to the asset manifest file name to avoid collisions.
Optional items:
Artifact (with Metadata) Path to the artifact to publish. Declare the item in Signing.props to sign and publish the artifact.
- ChecksumPath The destination path to generate a checksum file for the artifact. Set the `RelativeBlobPathParent`
property if the RelativeBlobPath for the generate checksum should be automatically set.
- PublishFlatContainer By default artifacts are published to blob artifacts. Set to false to publish to package artifacts.
- Kind [Package, Blob]. If set, overrides PublishFlatContainer usage. If not, then PublishFlatContainer=false == Package, true == Blob.
- RelativeBlobPath The relative blob path when publishing to blob artifacts.
- IsShipping Set to false to mark the artifact as non-shipping. Defaults to true.
-->
<PropertyGroup>
<!-- Disable target framework filtering for top level projects -->
<NoTargetFrameworkFiltering>true</NoTargetFrameworkFiltering>
</PropertyGroup>
<Import Project="BuildStep.props" />
<UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.GenerateChecksums" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
<!--
In VMR inner-build copy to local storage, do not push to AzDO.
Inner-repo builds outside of VMR do not use arcade publishing.
Define this property before importing repo Publishing.props, to have it control any repo-specific publishing.
-->
<PropertyGroup Condition="('$(DotNetBuildPhase)' == 'InnerRepo' or '$(UseArPowBuildInfra)' == 'false') and '$(DotNetBuildOrchestrator)' == 'true'">
<PushToLocalStorage>true</PushToLocalStorage>
</PropertyGroup>
<!--
Inside the VMR, we want to include "Vertical" artifacts as they should be available to other builds within the same
vertical on the same build machine.
Inside the VMR, we also want to include "Internal" artifacts in the build manifest, as they are used by other jobs
so we want to inclue them here so they can be in the vertical's final manifest.
The VMR tooling to produce the final merged manifest for the VMR build as a whole will filter them out.
-->
<ItemGroup Condition="('$(DotNetBuildPhase)' == 'InnerRepo' or '$(UseArPowBuildInfra)' == 'false') and '$(DotNetBuildOrchestrator)' == 'true'">
<ArtifactVisibilityToPublish Include="Vertical;Internal;External" />
</ItemGroup>
<!-- Required to determine whether full assembly strong name signing is supported, which may affect selection of some certificates. -->
<Import Project="StrongName.targets" />
<Import Project="Sign.props" />
<PropertyGroup>
<!-- Default publishing target is 3. -->
<PublishingVersion>3</PublishingVersion>
<!-- Globally set property. -->
<IsStableBuild>false</IsStableBuild>
<IsStableBuild Condition="'$(DotNetFinalVersionKind)' == 'release'">true</IsStableBuild>
<!-- If `IsReleaseOnlyPackageVersion` is set to true, package safety checks can be skipped-->
<IsReleaseOnlyPackageVersion>false</IsReleaseOnlyPackageVersion>
<IsReleaseOnlyPackageVersion Condition ="'$(SkipPackagePublishingVersionChecks)' == 'true' or ('$(PreReleaseVersionLabel)' == '' and '$(AutoGenerateAssemblyVersion)' == 'true')">true</IsReleaseOnlyPackageVersion>
<!-- If `AutoGenerateSymbolPackages` is not set we default it to true.
Do not generate symbol packages if in outer source build mode, to avoid creating copies of the intermediates.
Also do not generate symbol packages if in inner source build, in product build. -->
<AutoGenerateSymbolPackages Condition="'$(AutoGenerateSymbolPackages)' == '' and
('$(DotNetBuildSourceOnly)' != 'true' or (('$(DotNetBuildInnerRepo)' == 'true' or '$(UseArPowBuildInfra)' == 'false') and '$(DotNetBuildOrchestrator)' != 'true'))">true</AutoGenerateSymbolPackages>
<PreserveRepoOrigin Condition="'$(PreserveRepoOrigin)' == ''">false</PreserveRepoOrigin>
<PublishManifestOnly Condition="'$(PublishManifestOnly)' == ''">false</PublishManifestOnly>
<!-- This tracks the dependent targets of PublishToAzureDevOpsArtifacts. We can't rename this
property as it is used by other repositories already. -->
<PublishDependsOnTargets>BeforePublish;AutoGenerateSymbolPackages</PublishDependsOnTargets>
<SymbolPackageBaseRelativeBlobPath>assets/symbols/$(BUILD_REPOSITORY_NAME)/$(BUILD_BUILDNUMBER)/</SymbolPackageBaseRelativeBlobPath>
</PropertyGroup>
<!-- Keep these asset manifest properties here as other repos already depend on them in Publishing.props. -->
<PropertyGroup>
<!-- Prefer TargetOS when set over OS -->
<AssetManifestOS Condition="'$(AssetManifestOS)' == ''">$([MSBuild]::ValueOrDefault('$(TargetOS)', '$(OS)'))</AssetManifestOS>
<!-- Prefer TargetArchitecture when set over PlatformName -->
<AssetManifestArch Condition="'$(AssetManifestArch)' == ''">$([MSBuild]::ValueOrDefault('$(TargetArchitecture)', '$(PlatformName)'))</AssetManifestArch>
<!-- Add the build pass number when DotNetBuildPass is set to a value other than 1. -->
<AssetManifestPass Condition="'$(DotNetBuildPass)' != '' and '$(DotNetBuildPass)' != '1'">-Pass$(DotNetBuildPass)</AssetManifestPass>
</PropertyGroup>
<!-- Only publish packages that contain this build's Target RID in the name. -->
<ItemGroup Condition="'$(EnableDefaultArtifacts)' == 'true' and '$(EnableDefaultRidSpecificArtifacts)' == 'true'">
<Artifact Include="$(ArtifactsShippingPackagesDir)**/*.$(TargetRid).*.nupkg" Kind="Package" />
<Artifact Include="$(ArtifactsNonShippingPackagesDir)**/*.$(TargetRid).*.nupkg" IsShipping="false" Kind="Package" />
<!--
Integration with Microsoft.DotNet.Build.Tasks.Installers: Publish packages of the following formats as well.
These are arch-specific Visual Studio insertion packages. As they're Windows-only, they only include architecture in the name:
- VS.Redist.Common.*.$(TargetArchitecture).*.nupkg
- VS.Redist.Common.*.*_$(TargetArchitecture).*.nupkg
These packages are always non-shipping, so only look there.
-->
<Artifact Include="$(ArtifactsNonShippingPackagesDir)**/VS.Redist.Common.*.$(TargetArchitecture).*.nupkg" IsShipping="false" Kind="Package" />
<Artifact Include="$(ArtifactsNonShippingPackagesDir)**/VS.Redist.Common.*.*_$(TargetArchitecture).*.nupkg" IsShipping="false" Kind="Package" />
<!--
In the VMR, don't publish packages that didn't match the above conditions externally.
Instead, add them with Vertical visibility as they still may be needed to build RID-specific packages in other repos.
-->
<Artifact Include="$(ArtifactsShippingPackagesDir)**/*.nupkg" Exclude="@(Artifact)" Kind="Package" Visibility="Vertical" Condition="'$(DotNetBuildOrchestrator)' == 'true'" />
<Artifact Include="$(ArtifactsNonShippingPackagesDir)**/*.nupkg" Exclude="@(Artifact)" IsShipping="false" Kind="Package" Visibility="Vertical" Condition="'$(DotNetBuildOrchestrator)' == 'true'" />
</ItemGroup>
<ItemGroup Condition="'$(EnableDefaultArtifacts)' == 'true' and '$(EnableDefaultRidSpecificArtifacts)' != 'true'">
<Artifact Include="$(ArtifactsShippingPackagesDir)**/*.nupkg" Kind="Package" />
<Artifact Include="$(ArtifactsNonShippingPackagesDir)**/*.nupkg" IsShipping="false" Kind="Package" />
</ItemGroup>
<!-- Allow for repo specific Publish properties such as add additional files to be published -->
<Import Project="$(RepositoryEngineeringDir)Publishing.props" Condition="Exists('$(RepositoryEngineeringDir)Publishing.props')" />
<Import Project="$(NuGetPackageRoot)microsoft.dotnet.build.tasks.feed\$(MicrosoftDotNetBuildTasksFeedVersion)\build\Microsoft.DotNet.Build.Tasks.Feed.targets"/>
<Target Name="Publish" DependsOnTargets="PublishToAzureDevOpsArtifacts" />
<Target Name="BeforePublish" Condition="'@(Artifact)' != ''">
<ItemGroup>
<!-- Exclude all existing *.symbols.nupkg in source-only build - we create a unified symbols archive instead. -->
<_ExistingSymbolPackage Include="@(Artifact)" Condition="'$(DotNetBuildSourceOnly)' != 'true' and '%(Artifact.SkipPublish)' != 'true' and $([System.String]::Copy('%(Filename)%(Extension)').EndsWith('.symbols.nupkg'))">
<!-- Update the kind of the symbol packages to blob -->
<Kind>Blob</Kind>
<RelativeBlobPath>$(SymbolPackageBaseRelativeBlobPath)%(Filename)%(Extension)</RelativeBlobPath>
</_ExistingSymbolPackage>
<_PackageToPublish Include="@(Artifact)" Exclude="@(_ExistingSymbolPackage)" Condition="'%(Artifact.SkipPublish)' != 'true' and '%(Extension)' == '.nupkg'" />
</ItemGroup>
<ItemGroup>
<ItemsToPushToBlobFeed Include="@(_PackageToPublish);@(_ExistingSymbolPackage)" Exclude="@(ItemsToPushToBlobFeed)" />
</ItemGroup>
<!--
Publish Windows PDBs produced by SymStore.targets (by default, only shipping PDBs are placed there).
SymbolUploader doesn't support embedded PDBs yet, so let SymStore.targets do the conversion for now.
https://github.com/dotnet/symstore/issues/143
-->
<ItemGroup>
<FilesToPublishToSymbolServer Include="$(ArtifactsSymStoreDirectory)**\*.pdb"/>
<!-- Support existing uses of FilesToPublishToSymbolServer by translating this ItemGroup into ItemsToPushToBlobFeed,
with type PDB. Repositories can also add these items manually if desired.
Note that we are careful here to include the relative paths of those PDBs. Unlike most artifacts
that we deal with, many PDBs can have the same name but different contents. -->
<_SymbolsToPushToBlobFeed Include="@(FilesToPublishToSymbolServer)">
<Kind>PDB</Kind>
<RelativePDBPath>%(RecursiveDir)%(Filename)%(Extension)</RelativePDBPath>
</_SymbolsToPushToBlobFeed>
<ItemsToPushToBlobFeed Include="@(_SymbolsToPushToBlobFeed)" />
</ItemGroup>
</Target>
<Target Name="AutoGenerateSymbolPackages" DependsOnTargets="BeforePublish" Condition="'$(AutoGenerateSymbolPackages)' == 'true'">
<PropertyGroup>
<SymbolPackagesDir Condition="'$(SymbolPackagesDir)' == ''">$(ArtifactsTmpDir)SymbolPackages\</SymbolPackagesDir>
</PropertyGroup>
<ItemGroup>
<_PackageToPublish Update="@(_PackageToPublish)">
<SymbolPackageToGenerate Condition="!Exists('%(RootDir)%(Directory)%(Filename).symbols.nupkg')">$(SymbolPackagesDir)%(Filename).symbols.nupkg</SymbolPackageToGenerate>
<SymbolPackageRelativeBlobPath>$(SymbolPackageBaseRelativeBlobPath)/%(Filename).symbols.nupkg</SymbolPackageRelativeBlobPath>
</_PackageToPublish>
<_SymbolPackageToGenerate Include="@(_PackageToPublish->'%(SymbolPackageToGenerate)')"
Exclude="@(_ExistingSymbolPackage -> '$(SymbolPackagesDir)%(Filename)%(Extension)')"
Condition="'%(_PackageToPublish.SymbolPackageToGenerate)' != ''">
<OriginalPackage>%(_PackageToPublish.Identity)</OriginalPackage>
<IsShipping>%(_PackageToPublish.IsShipping)</IsShipping>
<Kind>Blob</Kind>
<RelativeBlobPath>%(_PackageToPublish.SymbolPackageRelativeBlobPath)</RelativeBlobPath>
</_SymbolPackageToGenerate>
</ItemGroup>
<!--
If a symbol package doesn't exist yet we assume that the regular package contains Portable PDBs.
Such packages can act as symbol packages since they have the same structure.
We just need to copy them to *.symbols.nupkg.
-->
<MakeDir Condition="'@(_SymbolPackageToGenerate)' != ''" Directories="$(SymbolPackagesDir)" />
<Copy SourceFiles="@(_SymbolPackageToGenerate->'%(OriginalPackage)')" DestinationFiles="@(_SymbolPackageToGenerate)" />
<ItemGroup>
<!--
These packages from Arcade-Services include some native libraries that
our current symbol uploader can't handle. Below is a workaround until
we get issue: https://github.com/dotnet/arcade/issues/2457 sorted.
-->
<_SymbolPackageToGenerate Remove="$(SymbolPackagesDir)**/Microsoft.DotNet.Darc.*" />
<_SymbolPackageToGenerate Remove="$(SymbolPackagesDir)**/Microsoft.DotNet.Maestro.Tasks.*" />
</ItemGroup>
<ItemGroup>
<ItemsToPushToBlobFeed Include="@(_SymbolPackageToGenerate)" Exclude="@(ItemsToPushToBlobFeed)" />
</ItemGroup>
</Target>
<!-- Generate checksums from artifact items that set ChecksumPath.
The produced checksums get automatically added as artifacts. -->
<Target Name="GenerateChecksumsFromArtifacts"
Condition="'@(Artifact)' != '' and '@(Artifact->HasMetadata('ChecksumPath'))' != ''">
<ItemGroup>
<GenerateChecksumItems Include="@(Artifact->HasMetadata('ChecksumPath'))"
DestinationPath="%(Artifact.ChecksumPath)"
RemoveMetadata="RelativeBlobPath" />
</ItemGroup>
<GenerateChecksums Items="@(GenerateChecksumItems)" />
<ItemGroup>
<!-- Set RelativeBlobPath if RelativeBlobPathParent is provided. -->
<GenerateChecksumItemsWithDestinationPath Include="@(GenerateChecksumItems -> '%(DestinationPath)')" />
<Artifact Include="@(GenerateChecksumItemsWithDestinationPath)">
<RelativeBlobPath Condition="'$(RelativeBlobPathParent)' != ''">$(RelativeBlobPathParent.TrimEnd('/'))/%(Filename)%(Extension)</RelativeBlobPath>
<Kind>Blob</Kind>
</Artifact>
</ItemGroup>
</Target>
<Target Name="PublishToAzureDevOpsArtifacts"
DependsOnTargets="$(PublishDependsOnTargets);GenerateChecksumsFromArtifacts">
<!--
Sadly AzDO doesn't have a variable to tell the account name. Also
the format of CollectionURI is not precise across different agent
configurations. Code below takes care of extracting the account
name from the CollectionURI in different formats.
-->
<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>
<!-- Directory where pdbs pointed in `FilesToPublishToSymbolServer` are copied before publishing to AzDO artifacts. -->
<PDBsToPublishTempLocation>$(ArtifactsTmpDir)PDBsToPublish/</PDBsToPublishTempLocation>
<PdbArtifactsSourceBuiltOrTempDir Condition="'$(PushToLocalStorage)' == 'true'">$(SourceBuiltPdbArtifactsDir)</PdbArtifactsSourceBuiltOrTempDir>
<PdbArtifactsSourceBuiltOrTempDir Condition="'$(PushToLocalStorage)' != 'true'">$(PDBsToPublishTempLocation)</PdbArtifactsSourceBuiltOrTempDir>
<!-- Use the SYSTEM_PHASENAME variable when available as that is guaranteed to be a unique identifier.
For local scenarios and when the variable isn't available, use "<os>-<arch>-<buildpass>"" as the manifest name. -->
<AssetManifestFileName Condition="'$(AssetManifestFileName)' == '' and '$(SYSTEM_PHASENAME)' != ''">$(SYSTEM_PHASENAME).xml</AssetManifestFileName>
<AssetManifestFileName Condition="'$(AssetManifestFileName)' == ''">$(AssetManifestOS)-$(AssetManifestArch)$(AssetManifestPass).xml</AssetManifestFileName>
<AssetManifestFilePath Condition="'$(AssetManifestFilePath)' == ''">$(ArtifactsLogDir)AssetManifest\$(AssetManifestFileName)</AssetManifestFilePath>
</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>
<!-- By default, don't publish wixpacks. They're only needed for signing and can be dropped from the publish phase. -->
<Artifact>
<SkipPublish Condition="'%(Artifact.SkipPublish)' == '' and $([System.String]::new('%(Filename)%(Extension)').EndsWith('.wixpack.zip'))">true</SkipPublish>
</Artifact>
<!-- Add non-package Artifact items (repo extension point) as package already got added in the BeforePublish target. -->
<ItemsToPushToBlobFeed Include="@(Artifact)" Condition="'%(Artifact.SkipPublish)' != 'true' and '%(Extension)' != '.nupkg'" />
</ItemGroup>
<!-- Update/add attributes of ItemsToPushToBlobFeed if they were not provided. -->
<ItemGroup>
<ItemsToPushToBlobFeed>
<!-- Default artifact visibility is External -->
<Visibility Condition="'%(ItemsToPushToBlobFeed.Visibility)' == ''">$([MSBuild]::ValueOrDefault('$(DefaultArtifactVisibility)', 'External'))</Visibility>
<!-- Default to IsShipping=true -->
<IsShipping Condition="'%(ItemsToPushToBlobFeed.IsShipping)' == ''">true</IsShipping>
<!-- An item is a Blob if Kind wasn't already set, and PublishFlatContainer is true.
An item is a Package if Kind wasn't already set, and PublishFlatContainer is false or not set.
An item is a Package if Kind wasn't already set, and PublishFlatContainer is not set. -->
<Kind Condition="'%(ItemsToPushToBlobFeed.Kind)' == '' and '%(ItemsToPushToBlobFeed.PublishFlatContainer)' == 'true'">Blob</Kind>
<Kind Condition="'%(ItemsToPushToBlobFeed.Kind)' == '' and '%(ItemsToPushToBlobFeed.PublishFlatContainer)' != 'true'">Package</Kind>
</ItemsToPushToBlobFeed>
</ItemGroup>
<!-- Note that the below ItemsToPushToBlobFeed metadata updates are in separate item groups to preserve previous information. -->
<ItemGroup>
<ItemsToPushToBlobFeed>
<ManifestArtifactData Condition="'%(ItemsToPushToBlobFeed.IsShipping)' != 'true'">%(ItemsToPushToBlobFeed.ManifestArtifactData);NonShipping=true</ManifestArtifactData>
<ManifestArtifactData Condition="'%(ItemsToPushToBlobFeed.IsShipping)' == 'true' and '$(ProducesDotNetReleaseShippingAssets)' == 'true'">%(ItemsToPushToBlobFeed.ManifestArtifactData);DotNetReleaseShipping=true</ManifestArtifactData>
</ItemsToPushToBlobFeed>
</ItemGroup>
<ItemGroup>
<ItemsToPushToBlobFeed>
<ManifestArtifactData Condition="'%(ItemsToPushToBlobFeed.Visibility)' != ''">%(ItemsToPushToBlobFeed.ManifestArtifactData);Visibility=%(ItemsToPushToBlobFeed.Visibility)</ManifestArtifactData>
</ItemsToPushToBlobFeed>
</ItemGroup>
<!-- Propagate stability data to the asset level for packages. We do this so that VMR builds which have some repo builds that are not stable, and others that are, do not end up having to use the default logic
where ALL assets that are shipping in a stable build go to isolated feeds. Instead, we can just choose CouldBeStable==true, CouldBeStable==false.
This only applies currently to Packages. Blobs are required to provide paths that are always non-stable. Pdbs don't have a stability concept.
NOTE: This flag doesn't strictly mean that the package is stable versioned. A repo might suppress a stable version for a given package. -->
<ItemGroup>
<ItemsToPushToBlobFeed>
<ManifestArtifactData Condition="'$(PublishingVersion)' == '4' and
'%(ItemsToPushToBlobFeed.Kind)' == 'Package' and
'$(IsStableBuild)' == 'true' and
'$(IsReleaseOnlyPackageVersion)' != 'true' and
'%(ItemsToPushToBlobFeed.IsShipping)' == 'true'">%(ItemsToPushToBlobFeed.ManifestArtifactData);CouldBeStable=true</ManifestArtifactData>
<!-- We narrowly set CouldBeStable=false only for packages we know won't generate a stable version because of IsReleaseOnlyPackageVersion == true.
This allows for the default 'stable asset to non-isolated feed' detection behavior to still pick up accidental cases of stabilization. -->
<ManifestArtifactData Condition="'$(PublishingVersion)' == '4' and
'%(ItemsToPushToBlobFeed.Kind)' == 'Package' and
'$(IsReleaseOnlyPackageVersion)' == 'true'">%(ItemsToPushToBlobFeed.ManifestArtifactData);CouldBeStable=false</ManifestArtifactData>
</ItemsToPushToBlobFeed>
</ItemGroup>
<Error Condition="'@(ItemsToPublishToBlobFeed->WithMetadataValue('IsShipping','true')->AnyHaveMetadataValue('Visibility','Vertical'))' == 'true'"
Text="Visibility 'Vertical' is not supported for shipping artifacts." />
<Error Condition="'@(ItemsToPublishToBlobFeed->WithMetadataValue('IsShipping','true')->AnyHaveMetadataValue('Visibility','Internal'))' == 'true'"
Text="Visibility 'Internal' is not supported for shipping artifacts." />
<Error Condition="'@(ItemsToPublishToBlobFeed->AnyHaveMetadataValue('Visibility','Vertical'))' == 'true' and '$(DotNetBuild)' != 'true'"
Text="Visibility 'Vertical' is only supported in vertical builds." />
<!--
The user can set `PublishingVersion` via eng\Publishing.props
-->
<PushToBuildStorage
AzureDevOpsCollectionUri="$(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)"
AzureDevOpsProject="$(SYSTEM_TEAMPROJECT)"
AzureDevOpsBuildId="$(BUILD_BUILDID)"
ItemsToPush="@(ItemsToPushToBlobFeed)"
ManifestBuildData="@(ManifestBuildData)"
ManifestRepoUri="$(BUILD_REPOSITORY_NAME)"
ManifestBranch="$(BUILD_SOURCEBRANCH)"
ManifestBuildId="$(BUILD_BUILDNUMBER)"
ManifestCommit="$(BUILD_SOURCEVERSION)"
ManifestRepoOrigin="$(GitHubRepositoryName)"
IsStableBuild="$(IsStableBuild)"
PublishingVersion="$(PublishingVersion)"
AssetManifestPath="$(AssetManifestFilePath)"
IsReleaseOnlyPackageVersion="$(IsReleaseOnlyPackageVersion)"
PushToLocalStorage="$(PushToLocalStorage)"
AssetsLocalStorageDir="$(SourceBuiltAssetsDir)"
PreserveRepoOrigin="$(PreserveRepoOrigin)"
ShippingPackagesLocalStorageDir="$(SourceBuiltShippingPackagesDir)"
NonShippingPackagesLocalStorageDir="$(SourceBuiltNonShippingPackagesDir)"
AssetManifestsLocalStorageDir="$(SourceBuiltAssetManifestsDir)"
PdbArtifactsLocalStorageDir="$(PdbArtifactsSourceBuiltOrTempDir)"
ArtifactVisibilitiesToPublish="@(ArtifactVisibilityToPublish)"
UseHardlinksIfPossible="$(PublishingUseHardlinksIfPossible)"
PublishManifestOnly="$(PublishManifestOnly)" />
</Target>
<!-- Import the publish targets when in the inner or outer repo builds. -->
<Import Project="SourceBuild/SourceBuildArcadePublish.targets" Condition="'$(DotNetBuildRepo)' == 'true' and '$(UseArPowBuildInfra)' != 'false'" />
</Project>