From ace6e859e7099ba1aafab7b4c252459c54929034 Mon Sep 17 00:00:00 2001 From: Sarah Oslund Date: Mon, 3 Aug 2020 16:02:18 -0700 Subject: [PATCH 1/2] Dynamically acquire branch info, remove branchinfo.props --- .vsts-ci.yml | 1 + src/CopyToLatest/CopyToLatest.csproj | 4 ++-- src/CopyToLatest/targets/BranchInfo.props | 5 ----- 3 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 src/CopyToLatest/targets/BranchInfo.props diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 05e608cd5..7cbab6ffd 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -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 diff --git a/src/CopyToLatest/CopyToLatest.csproj b/src/CopyToLatest/CopyToLatest.csproj index 21a9eb7bb..0af7950d0 100644 --- a/src/CopyToLatest/CopyToLatest.csproj +++ b/src/CopyToLatest/CopyToLatest.csproj @@ -3,12 +3,12 @@ $(CoreSdkTargetFramework) true false + $(SourceBranch.Replace('refs/heads/', '').Replace('internal/', '')) - - + \ No newline at end of file diff --git a/src/CopyToLatest/targets/BranchInfo.props b/src/CopyToLatest/targets/BranchInfo.props deleted file mode 100644 index 9bd214aa9..000000000 --- a/src/CopyToLatest/targets/BranchInfo.props +++ /dev/null @@ -1,5 +0,0 @@ - - - master - - From eeef3c72e807a0fd27ad2217376aa1f52bc7d864 Mon Sep 17 00:00:00 2001 From: Sarah Oslund Date: Wed, 5 Aug 2020 10:20:22 -0700 Subject: [PATCH 2/2] PR feedback --- src/CopyToLatest/CopyToLatest.csproj | 2 +- src/core-sdk-tasks/CopyBlobsToLatest.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/CopyToLatest/CopyToLatest.csproj b/src/CopyToLatest/CopyToLatest.csproj index 0af7950d0..a61ea4a61 100644 --- a/src/CopyToLatest/CopyToLatest.csproj +++ b/src/CopyToLatest/CopyToLatest.csproj @@ -3,7 +3,7 @@ $(CoreSdkTargetFramework) true false - $(SourceBranch.Replace('refs/heads/', '').Replace('internal/', '')) + $(SourceBranch.Replace('refs/heads/', '')) diff --git a/src/core-sdk-tasks/CopyBlobsToLatest.cs b/src/core-sdk-tasks/CopyBlobsToLatest.cs index 734898a73..a62000ba7 100644 --- a/src/core-sdk-tasks/CopyBlobsToLatest.cs +++ b/src/core-sdk-tasks/CopyBlobsToLatest.cs @@ -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}";