Skip to content

Commit 1d9b4bf

Browse files
committed
Refresh build script + upgrade to Cake 5.1
Necessary because recent repo name change
1 parent 7b6e001 commit 1d9b4bf

5 files changed

Lines changed: 26 additions & 26 deletions

File tree

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"cake.tool": {
6-
"version": "5.0.0",
6+
"version": "5.1.0",
77
"commands": [
88
"dotnet-cake"
99
]

CodeCoverage.runsettings

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<!-- Match fully qualified names of functions: -->
1111
<Functions>
1212
<Exclude>
13-
<Function>Http-Multipart-Data-Parser\.Properties\..*</Function>
14-
<Function>Http-Multipart-Data-Parser\.Models\..*</Function>
15-
<Function>Http-Multipart-Data-Parser\.Utilities\.Log\..*</Function>
13+
<Function>HttpMultipartParser\.Properties\..*</Function>
14+
<Function>HttpMultipartParser\.Models\..*</Function>
15+
<Function>HttpMultipartParser\.Utilities\.Log\..*</Function>
1616
<Function>System\.Text\.Json\.SourceGeneration\..*</Function>
1717
<Function>System\.Runtime\.CompilerServices\..*</Function>
1818
</Exclude>
@@ -21,7 +21,7 @@
2121
<!-- Match attributes on any code element: -->
2222
<Attributes>
2323
<Exclude>
24-
<Attribute>Http-Multipart-Data-Parser\.Utilities\.ExcludeFromCodeCoverageAttribute</Attribute>
24+
<Attribute>HttpMultipartParser\.Utilities\.ExcludeFromCodeCoverageAttribute</Attribute>
2525
<Attribute>System\.Obsolete</Attribute>
2626
<Attribute>System\.CodeDom\.Compiler\.GeneratedCodeAttribute</Attribute>
2727
<Attribute>System\.Runtime\.CompilerServices\.CompilerGeneratedAttribute</Attribute>

GitReleaseManager.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
create:
22
include-footer: false
33
footer-heading: Where to get it
4-
footer-content: You can download this release from [nuget.org](https://www.nuget.org/packages/Http-Multipart-Data-Parser/{milestone})
4+
footer-content: You can download this release from [nuget.org](https://www.nuget.org/packages/HttpMultipartParser/{milestone})
55
footer-includes-milestone: true
66
milestone-replace-text: '{milestone}'
77
include-contributors: true
@@ -14,7 +14,7 @@ close:
1414
The release is available on:
1515
1616
- [GitHub Release](https://github.com/{owner}/{repository}/releases/tag/{milestone})
17-
- [NuGet Package](https://www.nuget.org/packages/Http-Multipart-Data-Parser/{milestone})
17+
- [NuGet Package](https://www.nuget.org/packages/HttpMultipartParser/{milestone})
1818
1919
Your **[GitReleaseManager](https://github.com/GitTools/GitReleaseManager)** bot :package::rocket:
2020
export:

build.cake

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Install tools.
22
#tool dotnet:?package=GitVersion.Tool&version=6.4.0
33
#tool nuget:?package=GitReleaseManager&version=0.20.0
4-
#tool nuget:?package=ReportGenerator&version=5.4.13
4+
#tool nuget:?package=ReportGenerator&version=5.4.17
55
#tool nuget:?package=xunit.runner.console&version=2.9.3
66
#tool nuget:?package=CodecovUploader&version=0.8.0
77

@@ -24,8 +24,8 @@ if (IsRunningOnUnix()) target = "Run-Unit-Tests";
2424
// GLOBAL VARIABLES
2525
///////////////////////////////////////////////////////////////////////////////
2626

27-
var libraryName = "HttpMultipartParser";
28-
var gitHubRepo = "Http-Multipart-Data-Parser";
27+
var buildBranch = Context.GetBuildBranch();
28+
var repoFullName = Context.GetRepoName();
2929

3030
var nuGetApiUrl = Argument<string>("NUGET_API_URL", EnvironmentVariable("NUGET_API_URL"));
3131
var nuGetApiKey = Argument<string>("NUGET_API_KEY", EnvironmentVariable("NUGET_API_KEY"));
@@ -34,6 +34,7 @@ var gitHubToken = Argument<string>("GITHUB_TOKEN", EnvironmentVariable("GITHUB_T
3434
var gitHubUserName = Argument<string>("GITHUB_USERNAME", EnvironmentVariable("GITHUB_USERNAME"));
3535
var gitHubPassword = Argument<string>("GITHUB_PASSWORD", EnvironmentVariable("GITHUB_PASSWORD"));
3636
var gitHubRepoOwner = Argument<string>("GITHUB_REPOOWNER", EnvironmentVariable("GITHUB_REPOOWNER") ?? gitHubUserName);
37+
var gitHubRepoName = repoFullName.Split('/')[1];
3738

3839
var codecovToken = Argument<string>("CODECOV_TOKEN", EnvironmentVariable("CODECOV_TOKEN"));
3940

@@ -43,22 +44,19 @@ var codeCoverageDir = $"{outputDir}CodeCoverage/";
4344
var benchmarkDir = $"{outputDir}Benchmark/";
4445
var coverageFile = $"{codeCoverageDir}coverage.xml";
4546

46-
var solutionFile = $"{sourceFolder}{libraryName}.sln";
47-
var sourceProject = $"{sourceFolder}{libraryName}/{libraryName}.csproj";
48-
var integrationTestsProject = $"{sourceFolder}{libraryName}.IntegrationTests/{libraryName}.IntegrationTests.csproj";
49-
var unitTestsProject = $"{sourceFolder}{libraryName}.UnitTests/{libraryName}.UnitTests.csproj";
50-
var benchmarkProject = $"{sourceFolder}{libraryName}.Benchmark/{libraryName}.Benchmark.csproj";
51-
52-
var buildBranch = Context.GetBuildBranch();
53-
var repoName = Context.GetRepoName();
47+
var solutionFile = $"{sourceFolder}{gitHubRepoName}.sln";
48+
var sourceProject = $"{sourceFolder}{gitHubRepoName}/{gitHubRepoName}.csproj";
49+
var integrationTestsProject = $"{sourceFolder}{gitHubRepoName}.IntegrationTests/{gitHubRepoName}.IntegrationTests.csproj";
50+
var unitTestsProject = $"{sourceFolder}{gitHubRepoName}.UnitTests/{gitHubRepoName}.UnitTests.csproj";
51+
var benchmarkProject = $"{sourceFolder}{gitHubRepoName}.Benchmark/{gitHubRepoName}.Benchmark.csproj";
5452

5553
var versionInfo = (GitVersion)null; // Will be calculated in SETUP
5654
var milestone = string.Empty; // Will be calculated in SETUP
5755

5856
var cakeVersion = typeof(ICakeContext).Assembly.GetName().Version.ToString();
5957
var isLocalBuild = BuildSystem.IsLocalBuild;
6058
var isMainBranch = StringComparer.OrdinalIgnoreCase.Equals("main", buildBranch);
61-
var isMainRepo = StringComparer.OrdinalIgnoreCase.Equals($"{gitHubRepoOwner}/{gitHubRepo}", repoName);
59+
var isMainRepo = StringComparer.OrdinalIgnoreCase.Equals($"{gitHubRepoOwner}/{gitHubRepoName}", repoFullName);
6260
var isPullRequest = BuildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
6361
var isTagged = BuildSystem.AppVeyor.Environment.Repository.Tag.IsTag && !string.IsNullOrWhiteSpace(BuildSystem.AppVeyor.Environment.Repository.Tag.Name);
6462
var isIntegrationTestsProjectPresent = FileExists(integrationTestsProject);
@@ -97,7 +95,7 @@ Setup(context =>
9795

9896
Information("Building version {0} of {1} ({2}, {3}) using version {4} of Cake",
9997
versionInfo.FullSemVer,
100-
libraryName,
98+
gitHubRepoName,
10199
configuration,
102100
target,
103101
cakeVersion
@@ -119,15 +117,15 @@ Setup(context =>
119117
if (!string.IsNullOrEmpty(gitHubToken))
120118
{
121119
Information("GitHub Info:\r\n\tRepo: {0}\r\n\tUserName: {1}\r\n\tToken: {2}",
122-
$"{gitHubRepoOwner}/{gitHubRepo}",
120+
$"{gitHubRepoOwner}/{gitHubRepoName}",
123121
gitHubUserName,
124122
new string('*', gitHubToken.Length)
125123
);
126124
}
127125
else
128126
{
129127
Information("GitHub Info:\r\n\tRepo: {0}\r\n\tUserName: {1}\r\n\tPassword: {2}",
130-
$"{gitHubRepoOwner}/{gitHubRepo}",
128+
$"{gitHubRepoOwner}/{gitHubRepoName}",
131129
gitHubUserName,
132130
string.IsNullOrEmpty(gitHubPassword) ? "[NULL]" : new string('*', gitHubPassword.Length)
133131
);
@@ -312,7 +310,7 @@ Task("Create-NuGet-Package")
312310
.IsDependentOn("Build")
313311
.Does(() =>
314312
{
315-
var releaseNotesUrl = @$"https://github.com/{gitHubRepoOwner}/{gitHubRepo}/releases/tag/{milestone}";
313+
var releaseNotesUrl = @$"https://github.com/{gitHubRepoOwner}/{gitHubRepoName}/releases/tag/{milestone}";
316314

317315
var settings = new DotNetPackSettings
318316
{
@@ -382,7 +380,7 @@ Task("Create-Release-Notes")
382380
throw new InvalidOperationException("GitHub token was not provided.");
383381
}
384382

385-
GitReleaseManagerCreate(gitHubToken, gitHubRepoOwner, gitHubRepo, new GitReleaseManagerCreateSettings
383+
GitReleaseManagerCreate(gitHubToken, gitHubRepoOwner, gitHubRepoName, new GitReleaseManagerCreateSettings
386384
{
387385
Name = milestone,
388386
Milestone = milestone,
@@ -405,7 +403,7 @@ Task("Publish-GitHub-Release")
405403
throw new InvalidOperationException("GitHub token was not provided.");
406404
}
407405

408-
GitReleaseManagerClose(gitHubToken, gitHubRepoOwner, gitHubRepo, milestone, new GitReleaseManagerCloseMilestoneSettings
406+
GitReleaseManagerClose(gitHubToken, gitHubRepoOwner, gitHubRepoName, milestone, new GitReleaseManagerCloseMilestoneSettings
409407
{
410408
Verbose = true
411409
});
@@ -417,7 +415,7 @@ Task("Generate-Benchmark-Report")
417415
.Does(() =>
418416
{
419417
var publishDirectory = $"{benchmarkDir}Publish/";
420-
var publishedAppLocation = MakeAbsolute(File($"{publishDirectory}{libraryName}.Benchmark.exe")).FullPath;
418+
var publishedAppLocation = MakeAbsolute(File($"{publishDirectory}{gitHubRepoName}.Benchmark.exe")).FullPath;
421419
var artifactsLocation = MakeAbsolute(File(benchmarkDir)).FullPath;
422420

423421
DotNetPublish(benchmarkProject, new DotNetPublishSettings

dotnet.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[dotnet.test.runner]
2+
name = "Microsoft.Testing.Platform"

0 commit comments

Comments
 (0)