diff options
author | Jo Shields <joshield@microsoft.com> | 2019-05-02 17:24:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-02 17:24:10 +0300 |
commit | 748da2e4a93e820540f857ee8c6d3f752141f4de (patch) | |
tree | 33627940240d5ba4863da6ab11fd52c479c0c100 /eng/common/PublishToPackageFeed.proj | |
parent | c9c50f85f4ea7368b1aeaaed27564fcf6a1a3609 (diff) |
[netcore] Onboard Arcade (#14301)
Diffstat (limited to 'eng/common/PublishToPackageFeed.proj')
-rw-r--r-- | eng/common/PublishToPackageFeed.proj | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/eng/common/PublishToPackageFeed.proj b/eng/common/PublishToPackageFeed.proj new file mode 100644 index 00000000000..6d8b6b42fb2 --- /dev/null +++ b/eng/common/PublishToPackageFeed.proj @@ -0,0 +1,82 @@ +<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> +<Project Sdk="Microsoft.NET.Sdk"> + <!-- + This MSBuild file is intended to be used as the body of the default + publishing release pipeline. The release pipeline will use this file + to invoke the PushToStaticFeed task that will read the build asset + manifest and publish the assets described in the manifest to + informed target feeds. + --> + + <PropertyGroup> + <TargetFramework>netcoreapp2.1</TargetFramework> + </PropertyGroup> + + <Import Project="$(MSBuildThisFileDirectory)DefaultVersions.props" Condition="Exists('$(MSBuildThisFileDirectory)DefaultVersions.props')" /> + + <!-- + This won't be necessary once we solve this issue: + https://github.com/dotnet/arcade/issues/2266 + --> + <Import Project="$(MSBuildThisFileDirectory)ArtifactsCategory.props" Condition="Exists('$(MSBuildThisFileDirectory)ArtifactsCategory.props')" /> + + <Import Project="$(NuGetPackageRoot)microsoft.dotnet.build.tasks.feed\$(MicrosoftDotNetBuildTasksFeedVersion)\build\Microsoft.DotNet.Build.Tasks.Feed.targets" /> + + <Target Name="PublishToFeed"> + <Error Condition="'$(ArtifactsCategory)' == ''" Text="ArtifactsCategory: The artifacts' category produced by the build wasn't provided." /> + <Error Condition="'$(AccountKeyToStaticFeed)' == ''" Text="AccountKeyToStaticFeed: Account key for target feed wasn't provided." /> + <Error Condition="'$(ManifestsBasePath)' == ''" Text="Full path to asset manifests directory wasn't provided." /> + <Error Condition="'$(BlobBasePath)' == '' AND '$(PackageBasePath)' == ''" Text="A valid full path to BlobBasePath of PackageBasePath is required." /> + + <ItemGroup> + <!-- Include all manifests found in the manifest folder. --> + <ManifestFiles Include="$(ManifestsBasePath)*.xml" /> + </ItemGroup> + + <Error Condition="'@(ManifestFiles)' == ''" Text="No manifest file was found in the provided path: $(ManifestsBasePath)" /> + + <!-- + For now the type of packages being published will be informed for the whole build. + Eventually this will be specified on a per package basis: + TODO: https://github.com/dotnet/arcade/issues/2266 + --> + <PropertyGroup> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == '.NETCORE'">https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == '.NETCOREVALIDATION'">https://dotnetfeed.blob.core.windows.net/arcade-validation/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETCORE'">https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETCORETOOLING'">https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ENTITYFRAMEWORKCORE'">https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETEXTENSIONS'">https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'CORECLR'">https://dotnetfeed.blob.core.windows.net/dotnet-coreclr/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'MONO'">https://dotnetfeed.blob.core.windows.net/mono-mono/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'CORESDK'">https://dotnetfeed.blob.core.windows.net/dotnet-sdk/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'TOOLSINTERNAL'">https://dotnetfeed.blob.core.windows.net/dotnet-tools-internal/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'TOOLSET'">https://dotnetfeed.blob.core.windows.net/dotnet-toolset/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'WINDOWSDESKTOP'">https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json</TargetStaticFeed> + <TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'NUGETCLIENT'">https://dotnetfeed.blob.core.windows.net/nuget-nugetclient/index.json</TargetStaticFeed> + </PropertyGroup> + + <Error + Condition="'$(TargetStaticFeed)' == ''" + Text="'$(ArtifactsCategory)' wasn't recognized as a valid artifact category. Valid categories are: '.NetCore' and '.NetCoreValidation'" /> + + <!-- Iterate publishing assets from each manifest file. --> + <PushArtifactsInManifestToFeed + ExpectedFeedUrl="$(TargetStaticFeed)" + AccountKey="$(AccountKeyToStaticFeed)" + BARBuildId="$(BARBuildId)" + MaestroApiEndpoint="$(MaestroApiEndpoint)" + BuildAssetRegistryToken="$(BuildAssetRegistryToken)" + Overwrite="$(OverrideAssetsWithSameName)" + PassIfExistingItemIdentical="$(PassIfExistingItemIdentical)" + MaxClients="$(MaxParallelUploads)" + UploadTimeoutInMinutes="$(MaxUploadTimeoutInMinutes)" + AssetManifestPath="%(ManifestFiles.Identity)" + BlobAssetsBasePath="$(BlobBasePath)" + PackageAssetsBasePath="$(PackageBasePath)"/> + </Target> + + <ItemGroup> + <PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" /> + </ItemGroup> +</Project> |