Merge pull request #8092 from sfoslund/BranchInfo
Dynamically acquire branch info
This commit is contained in:
commit
bbbf208d03
4 changed files with 8 additions and 7 deletions
|
@ -301,4 +301,5 @@ stages:
|
|||
/p:DotNetPublishSdkAssetsBlobFeedKey=$(dotnetcli-storage-key)
|
||||
/p:DotnetPublishChecksumsBlobFeedUrl=https://dotnetclichecksums.blob.core.windows.net/dotnet/index.json
|
||||
/p:DotNetPublishChecksumsBlobFeedKey=$(dotnetclichecksums-storage-key)
|
||||
/p:SourceBranch=$(BUILD.SOURCEBRANCH)
|
||||
displayName: Copy to latest
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
<TargetFramework>$(CoreSdkTargetFramework)</TargetFramework>
|
||||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
||||
<CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
|
||||
<Channel>$(SourceBranch.Replace('refs/heads/', ''))</Channel>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="targets\BranchInfo.props" />
|
||||
<Import Project="..\redist\targets\BuildCoreSdkTasks.targets" />
|
||||
<Import Project="..\redist\targets\GetRuntimeInformation.targets" />
|
||||
<Import Project="..\redist\targets\Versions.targets" />
|
||||
|
||||
<Import Project="targets\FinishBuild.targets" />
|
||||
</Project>
|
||||
</Project>
|
|
@ -1,5 +0,0 @@
|
|||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Channel>master</Channel>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -64,6 +64,11 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
|
||||
public override bool Execute()
|
||||
{
|
||||
if (!(Channel.Equals("master") || Channel.Equals("main") || Channel.StartsWith("release")))
|
||||
{
|
||||
return true; // Skip copy to latest, we don't want to publish to arbitrary places
|
||||
}
|
||||
|
||||
string targetFolder = $"{AzurePublisher.Product.Sdk}/{Channel}";
|
||||
|
||||
string targetVersionFile = $"{targetFolder}/{CommitHash}";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue