summaryrefslogtreecommitdiff
path: root/src/publishwitharcade.proj
blob: b88b54f25a98552d4172fe196d9e533c6375492b (plain)
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
<Project DefaultTargets="PublishPackages">

  <!-- Publishing should always use Arcade -->
  <PropertyGroup>
    <ArcadeBuild>true</ArcadeBuild>
  </PropertyGroup>

  <Import Project="Directory.Build.props" />

  <Import Project="$(NuGetPackageRoot)microsoft.dotnet.build.tasks.feed\$(MicrosoftDotNetBuildTasksFeedVersion)\build\Microsoft.DotNet.Build.Tasks.Feed.targets" />

  <PropertyGroup>
    <!-- Set the TargetFramework just to make the SDK happy -->
    <TargetFramework>net462</TargetFramework>
  </PropertyGroup>

  <Target Name="PublishPackages">

    <ItemGroup>
      <PackagesToPublish Include="$(PackagesBinDir)pkg\*.nupkg" IsShipping="true" />
      <PackagesToPublish Update="$(PackagesBinDir)pkg\transport*.nupkg" IsShipping="false" />
      <SymbolPackagesToPublish Include="$(PackagesBinDir)symbolpkg\*.nupkg" IsShipping="true" />
    </ItemGroup>

    <!-- Managed-only packages are built on each windows leg, but we
         only want to upload them once. Let's arbitrarily upload these
         only from the x64 leg. -->
    <ItemGroup Condition=" '$(BuildArch)' != 'x64' ">
      <PackagesToPublish Remove="$(PackagesBinDir)pkg\*Microsoft.NET.Sdk.IL*.nupkg" />
      <PackagesToPublish Remove="$(PackagesBinDir)pkg\*Microsoft.TargetingPack.Private.CoreCLR*.nupkg" />
      <SymbolPackagesToPublish Remove="$(PackagesBinDir)symbolpkg\Microsoft.NET.Sdk.IL*.nupkg" />
      <SymbolPackagesToPublish Remove="$(PackagesBinDir)symbolpkg\Microsoft.TargetingPack.Private.CoreCLR*.nupkg" />
    </ItemGroup>

    <ItemGroup>
      <ItemsToPushToBlobFeed Include="@(PackagesToPublish);@(SymbolPackagesToPublish)">
        <ManifestArtifactData Condition="!%(IsShipping)">NonShipping=true</ManifestArtifactData> <!-- TODO: how is this metadata used? -->
      </ItemsToPushToBlobFeed>
    </ItemGroup>

    <Error Condition=" '$(AzureFeedUrl)' == '' " Text="AzureFeedUrl must be set" />
    <Error Condition=" '$(AzureAccountKey)' == '' " Text="AzureAccountKey must be set" />
    <Error Condition=" '$(BUILD_REPOSITORY_URI)' == '' " Text="BUILD_REPOSITORY_URI must be set" />
    <Error Condition=" '$(BUILD_SOURCEBRANCH)' == '' " Text="BUILD_SOURCEBRANCH must be set" />
    <Error Condition=" '$(BUILD_BUILDNUMBER)' == '' " Text="BUILD_BUILDNUMBER must be set" />
    <Error Condition=" '$(BUILD_SOURCEVERSION)' == '' " Text="BUILD_SOURCEVERSION must be set" />


    <PropertyGroup>
      <AssetManifestFilePath>$(ArtifactsLogDir)AssetManifest\$(OSIdentifier)-$(BuildArch)</AssetManifestFilePath>
      <!-- Work around an issue where the repo URI is different on
           OSX, causing the manifests to have different headers, which
           makes publishing to BAR fail later when it tries to merge
           the manifests. -->
      <_TemporaryBuildRepositoryUri>$(BUILD_REPOSITORY_URI)</_TemporaryBuildRepositoryUri>
      <_TemporaryBuildRepositoryUri Condition="'$(BUILD_REPOSITORY_URI)' == 'https://dnceng.visualstudio.com/internal/_git/dotnet-coreclr'" >https://dnceng@dev.azure.com/dnceng/internal/_git/dotnet-coreclr</_TemporaryBuildRepositoryUri>
    </PropertyGroup>

    <Message Importance="High" Text="BUILD_REPOSITORY_URI: $(BUILD_REPOSITORY_URI)" />
    <Message Importance="High" Text="_TemporaryBuildRepositoryUri: $(_TemporaryBuildRepositoryUri)" />

    <PushToBlobFeed ExpectedFeedUrl="$(AzureFeedUrl)"
                    AccountKey="$(AzureAccountKey)"
                    ItemsToPush="@(ItemsToPushToBlobFeed)"
                    ManifestBuildData="Location=$(AzureFeedUrl)"
                    ManifestRepoUri="$(_TemporaryBuildRepositoryUri)"
                    ManifestBranch="$(BUILD_SOURCEBRANCH)"
                    ManifestBuildId="$(BUILD_BUILDNUMBER)"
                    ManifestCommit="$(BUILD_SOURCEVERSION)"
                    AssetManifestPath="$(AssetManifestFilePath)" />
  </Target>

</Project>