Skip to content

Commit 529981e

Browse files
authored
Merge pull request #1093 from gep13/bug/GH-1088
Control when an attempt is made to upload releasenotes.md
2 parents 9eb8711 + 8a9ae45 commit 529981e

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": ".NET Core Launch (console)",
6+
"type": "coreclr",
7+
"request": "launch",
8+
"program": "${workspaceRoot}/tools/Cake.CoreCLR/Cake.dll",
9+
"args": [
10+
"${workspaceRoot}/build.cake",
11+
"--debug",
12+
"--verbosity=diagnostic"
13+
],
14+
"cwd": "${workspaceRoot}",
15+
"stopAtEntry": true,
16+
"externalConsole": false
17+
}
18+
]
19+
}

build.cake

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ bool IsTagged = (BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag &&
1414
!string.IsNullOrWhiteSpace(BuildSystem.AppVeyor.Environment.Repository.Tag.Name));
1515
bool IsMainGitVersionRepo = StringComparer.OrdinalIgnoreCase.Equals("gittools/gitversion", BuildSystem.AppVeyor.Environment.Repository.Name);
1616
bool IsPullRequest = BuildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
17+
bool IsMainGitVersionBranch = StringComparer.OrdinalIgnoreCase.Equals("master", BuildSystem.AppVeyor.Environment.Repository.Branch);
1718

1819
void Build(string configuration, string nugetVersion, string semVersion, string version, string preReleaseTag)
1920
{
@@ -120,6 +121,7 @@ Task("Zip-Files")
120121

121122
Task("Create-Release-Notes")
122123
.IsDependentOn("Build")
124+
.WithCriteria(() => IsMainGitVersionRepo && IsMainGitVersionBranch && !IsPullRequest)
123125
.Does(() =>
124126
{
125127
var githubToken = EnvironmentVariable("GitHubToken");
@@ -160,8 +162,7 @@ Task("Upload-AppVeyor-Artifacts")
160162
"NuGetTaskBuild:GitVersionTask." + nugetVersion +".nupkg",
161163
"GitVersionTfsTaskBuild:gittools.gitversion-" + semVersion +".vsix",
162164
"GemBuild:" + gem,
163-
"zip:GitVersion_" + nugetVersion + ".zip",
164-
"releaseNotes:releasenotes.md"
165+
"zip:GitVersion_" + nugetVersion + ".zip"
165166
});
166167

167168
AppVeyor.UploadArtifact("build/NuGetExeBuild/GitVersion.Portable." + nugetVersion +".nupkg");
@@ -171,8 +172,15 @@ Task("Upload-AppVeyor-Artifacts")
171172
AppVeyor.UploadArtifact("build/GitVersionTfsTaskBuild/gittools.gitversion-" + semVersion + ".vsix");
172173
AppVeyor.UploadArtifact("build/GitVersion_" + nugetVersion + ".zip");
173174
AppVeyor.UploadArtifact("build/GemBuild/" + gem);
174-
AppVeyor.UploadArtifact("build/releasenotes.md");
175175
AppVeyor.UploadArtifact("build/artifacts");
176+
177+
if(IsMainGitVersionRepo && IsMainGitVersionBranch && !IsPullRequest)
178+
{
179+
if(FileExists("build/releasenotes.md"))
180+
{
181+
AppVeyor.UploadArtifact("build/releasenotes.md");
182+
}
183+
}
176184
});
177185

178186

tools/packages.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Cake" version="0.17.0" />
4+
<package id="Cake.CoreCLR" version="0.17.0" />
5+
</packages>

0 commit comments

Comments
 (0)