Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish only the desired package versions #24843

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Publish only the desired package versions
Roslyn produces multiple versions of the same package. For product construction, only push those packages we need downstream
  • Loading branch information
mmitche committed Feb 14, 2018
commit 42997f36dab2ea0bf6738ba49b480892b039b9a1
21 changes: 19 additions & 2 deletions src/Tools/MicroBuild/PublishBlobAssets.proj
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
<Project>
<Project DefaultTargets="Build">

<Import Project="..\..\..\build\Targets\Settings.props" />

<!-- Based on two incoming properties (PublishStableVersions and VersionStampToPublish, determine what packages to push for the .NET Core build
PublishStableVersions = false - Push PerBuildPreRelease
PublishStableVersions = true - Push either PreRelease or Release, based on VersionStampToPublish value
VersionStampToPublish = '' - Push Release
VersionStampToPublish != '' - Push PreRelease
PublishStableVersions = false and VersionStampToPublish == '' - Error, no per build versioning of release builds
-->

<PropertyGroup>
<PublishOverwrite Condition="'$(PublishOverwrite)' == ''">false</PublishOverwrite>
<PublishStableVersions Condition="'$(PublishStableVersions)' == ''">false</PublishStableVersions>
</PropertyGroup>

<!--
This is for the internal orchestrated build scenarios and will likely never be run on a
developer's machine. The official build definition builds this file directly.
-->

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

<ItemGroup>
<ItemsToPush Include="$(OutputPath)\NuGet\**\*.nupkg" />
<ItemsToPush Include="$(OutputPath)\NuGet\PerBuildPreRelease\*.nupkg" Condition="'$(PublishStableVersions)'=='false'"/>
<ItemsToPush Include="$(OutputPath)\NuGet\Release\*.nupkg" Condition="'$(PublishStableVersions)'=='true' and '$(VersionStampToPublish)'==''"/>
<ItemsToPush Include="$(OutputPath)\NuGet\PreRelease\*.nupkg" Condition="'$(PublishStableVersions)'=='true' and '$(VersionStampToPublish)'!=''"/>
</ItemGroup>

<Target Name="Build">
<Error Text="Invalid combination of PublishStableVersions and VersionStampToPublish" Condition="'$(PublishStableVersions)'=='false' and '$(VersionStampToPublish)'==''" />
<Error Text="Missing storage account key as PB_PublishBlobFeedKey" Condition="'$(PB_PublishBlobFeedKey)'==''" />
<Error Text="Missing expected feed url as PB_PublishBlobFeedUrl" Condition="'$(PB_PublishBlobFeedUrl)'==''" />
<Error Text="No Items to push at $(OutputPath)" Condition="'@(ItemsToPush)'==''" />

<PushToBlobFeed ExpectedFeedUrl="$(PB_PublishBlobFeedUrl)"
AccountKey="$(PB_PublishBlobFeedKey)"
ItemsToPush="@(ItemsToPush)"
Expand Down