diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 473566e3..d249b4c0 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
- "version": "0.38.5",
+ "version": "1.3.0",
"commands": [
"dotnet-cake"
]
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e1a100f0..f7052178 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -26,6 +26,13 @@ jobs:
- name: Fetch all tags and branches
run: git fetch --prune --unshallow
+ - name: Install .NET SDK 3.1.x and 5.0.x
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: |
+ 3.1.x
+ 5.0.x
+
- name: Cache Tools
uses: actions/cache@v2
with:
@@ -38,8 +45,7 @@ jobs:
script-path: recipe.cake
target: CI
verbosity: Normal
- cake-version: 0.38.5
- cake-bootstrap: true
+ cake-version: tool-manifest
- name: Upload Issues-Report
uses: actions/upload-artifact@v2
diff --git a/cake.config b/cake.config
index 65324f55..a5fa61f5 100644
--- a/cake.config
+++ b/cake.config
@@ -3,7 +3,6 @@
[Nuget]
Source=https://api.nuget.org/v3/index.json
-UseInProcessClient=true
[Paths]
Tools=./tools
diff --git a/gitversion.yml b/gitversion.yml
new file mode 100644
index 00000000..f5a04cc7
--- /dev/null
+++ b/gitversion.yml
@@ -0,0 +1 @@
+next-version: 0.14.0
\ No newline at end of file
diff --git a/recipe.cake b/recipe.cake
index 66e5bf04..ec91a75f 100644
--- a/recipe.cake
+++ b/recipe.cake
@@ -1,4 +1,4 @@
-#load nuget:?package=Cake.Recipe&version=2.2.1
+#load nuget:?package=Cake.Recipe&version=3.0.1
#tool dotnet:?package=dotnet-t4&version=2.2.1
Environment.SetVariableNames(githubTokenVariable: "GITTOOLS_GITHUB_TOKEN");
@@ -14,7 +14,6 @@ BuildParameters.SetParameters(context: Context,
appVeyorAccountName: "GitTools",
shouldRunDotNetCorePack: true,
shouldRunIntegrationTests: true,
- shouldRunDupFinder: false,
integrationTestScriptPath: "./tests/integration/tests.cake",
twitterMessage: standardNotificationMessage,
gitterMessage: "@/all " + standardNotificationMessage);
@@ -24,12 +23,6 @@ BuildParameters.PackageSources.Add(new PackageSourceData(Context, "GPR", "https:
BuildParameters.PrintParameters(Context);
ToolSettings.SetToolSettings(context: Context,
- dupFinderExcludePattern: new string[] {
- BuildParameters.RootDirectoryPath + "/src/GitReleaseManager.Core.Tests/**/*.cs",
- BuildParameters.RootDirectoryPath + "/src/GitReleaseManager.Tests/**/*.cs",
- BuildParameters.RootDirectoryPath + "/src/GitReleaseManager.IntegrationTests/**/*.cs",
- BuildParameters.RootDirectoryPath + "/src/GitReleaseManager/AutoMapperConfiguration.cs",
- "**/*.AssemblyInfo.cs" },
testCoverageFilter: "+[GitReleaseManager*]* -[GitReleaseManager.Core.Tests*]* -[GitReleaseManager.Tests*]*",
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 7865b3a2..0c06577b 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -14,12 +14,12 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
@@ -27,7 +27,7 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
All
diff --git a/src/GitReleaseManager.Cli/GitReleaseManager.Cli.csproj b/src/GitReleaseManager.Cli/GitReleaseManager.Cli.csproj
index 59676e72..c2b810c3 100644
--- a/src/GitReleaseManager.Cli/GitReleaseManager.Cli.csproj
+++ b/src/GitReleaseManager.Cli/GitReleaseManager.Cli.csproj
@@ -13,15 +13,15 @@
-
-
-
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
diff --git a/src/GitReleaseManager.Core.Tests/GitReleaseManager.Core.Tests.csproj b/src/GitReleaseManager.Core.Tests/GitReleaseManager.Core.Tests.csproj
index 9ef6d7ee..5a2a642e 100644
--- a/src/GitReleaseManager.Core.Tests/GitReleaseManager.Core.Tests.csproj
+++ b/src/GitReleaseManager.Core.Tests/GitReleaseManager.Core.Tests.csproj
@@ -1,4 +1,4 @@
-
+
8.0
net472;netcoreapp3.1;net6.0
@@ -13,22 +13,20 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/src/GitReleaseManager.Core.Tests/VcsServiceTests.cs b/src/GitReleaseManager.Core.Tests/VcsServiceTests.cs
index 09889a8f..202c370e 100644
--- a/src/GitReleaseManager.Core.Tests/VcsServiceTests.cs
+++ b/src/GitReleaseManager.Core.Tests/VcsServiceTests.cs
@@ -321,6 +321,45 @@ await _vcsProvider.Received(1).CreateReleaseAsync(OWNER, REPOSITORY, Arg.Is(), Arg.Any());
}
+ [Test]
+ public async Task Should_Create_Release_From_Milestone_With_Assets()
+ {
+ var release = new Release { Assets = new List() };
+
+ var assetsCount = _assets.Count;
+
+ _releaseNotesBuilder.BuildReleaseNotes(OWNER, REPOSITORY, MILESTONE_TITLE, ReleaseTemplates.DEFAULT_NAME)
+ .Returns(Task.FromResult(RELEASE_NOTES));
+
+ _vcsProvider.GetReleaseAsync(OWNER, REPOSITORY, MILESTONE_TITLE)
+ .Returns(Task.FromResult(null));
+
+ _vcsProvider.CreateReleaseAsync(OWNER, REPOSITORY, Arg.Any())
+ .Returns(Task.FromResult(release));
+
+ var result = await _vcsService.CreateReleaseFromMilestoneAsync(
+ OWNER,
+ REPOSITORY,
+ MILESTONE_TITLE,
+ MILESTONE_TITLE,
+ null,
+ _assets,
+ false,
+ null
+ ).ConfigureAwait(false);
+ result.ShouldBeSameAs(release);
+
+ await _releaseNotesBuilder.Received(1).BuildReleaseNotes(OWNER, REPOSITORY, MILESTONE_TITLE, ReleaseTemplates.DEFAULT_NAME).ConfigureAwait(false);
+ await _vcsProvider.Received(1).GetReleaseAsync(OWNER, REPOSITORY, MILESTONE_TITLE).ConfigureAwait(false);
+ await _vcsProvider.Received(1).CreateReleaseAsync(OWNER, REPOSITORY, Arg.Is(o =>
+ o.Body == RELEASE_NOTES &&
+ o.Name == MILESTONE_TITLE &&
+ o.TagName == MILESTONE_TITLE)).ConfigureAwait(false);
+
+ _logger.Received(1).Verbose(Arg.Any(), MILESTONE_TITLE, OWNER, REPOSITORY);
+ _logger.Received(1).Debug(Arg.Any(), Arg.Any());
+ }
+
[Test]
public async Task Should_Create_Release_From_Milestone_Using_Template_File()
{
diff --git a/src/GitReleaseManager.Core/Configuration/ConfigSerializer.cs b/src/GitReleaseManager.Core/Configuration/ConfigSerializer.cs
index 102b1833..f144fe4f 100644
--- a/src/GitReleaseManager.Core/Configuration/ConfigSerializer.cs
+++ b/src/GitReleaseManager.Core/Configuration/ConfigSerializer.cs
@@ -94,6 +94,7 @@ private static void SetConfigurationSamples(object config, Type configType, Text
{
property.SetValue(config, null);
}
+
continue;
}
else if (yamlMemberAttribute.DefaultValuesHandling == DefaultValuesHandling.OmitNull)
diff --git a/src/GitReleaseManager.Core/Exceptions/InvalidIssuesException.cs b/src/GitReleaseManager.Core/Exceptions/InvalidIssuesException.cs
index add90d13..bad42797 100644
--- a/src/GitReleaseManager.Core/Exceptions/InvalidIssuesException.cs
+++ b/src/GitReleaseManager.Core/Exceptions/InvalidIssuesException.cs
@@ -33,6 +33,8 @@ public InvalidIssuesException(List errors, string message, Exception inn
protected InvalidIssuesException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
- : base(info, context) { }
+ : base(info, context)
+ {
+ }
}
}
diff --git a/src/GitReleaseManager.Core/Extensions/StringExtensions.cs b/src/GitReleaseManager.Core/Extensions/StringExtensions.cs
index 2d106c09..2fbe9fc9 100644
--- a/src/GitReleaseManager.Core/Extensions/StringExtensions.cs
+++ b/src/GitReleaseManager.Core/Extensions/StringExtensions.cs
@@ -10,10 +10,12 @@ internal static class StringExtensions
{
public static string ReplaceMilestoneTitle(this string source, string milestoneKey, string milestoneTitle)
{
+#pragma warning disable SA1001 // Commas should be spaced correctly
var dict = new Dictionary
{
{ milestoneKey.Trim('{','}'), milestoneTitle },
};
+#pragma warning restore SA1001 // Commas should be spaced correctly
return source.ReplaceTemplate(dict);
}
diff --git a/src/GitReleaseManager.Core/GitReleaseManager.Core.csproj b/src/GitReleaseManager.Core/GitReleaseManager.Core.csproj
index 163e47a2..39cf63ee 100644
--- a/src/GitReleaseManager.Core/GitReleaseManager.Core.csproj
+++ b/src/GitReleaseManager.Core/GitReleaseManager.Core.csproj
@@ -17,14 +17,14 @@
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
diff --git a/src/GitReleaseManager.Core/VcsService.cs b/src/GitReleaseManager.Core/VcsService.cs
index 8d7a6f46..a101e2e3 100644
--- a/src/GitReleaseManager.Core/VcsService.cs
+++ b/src/GitReleaseManager.Core/VcsService.cs
@@ -101,7 +101,7 @@ private async Task CreateReleaseAsync(string owner, string repository,
await _vcsProvider.UpdateReleaseAsync(owner, repository, release).ConfigureAwait(false);
}
- await AddAssetsAsync(owner, repository, tagName, assets).ConfigureAwait(false);
+ await AddAssetsAsync(owner, repository, tagName, assets, release).ConfigureAwait(false);
return release;
}
@@ -127,13 +127,15 @@ public async Task DiscardReleaseAsync(string owner, string repository, string ta
}
}
- public async Task AddAssetsAsync(string owner, string repository, string tagName, IList assets)
+ public async Task AddAssetsAsync(string owner, string repository, string tagName, IList assets) => await AddAssetsAsync(owner, repository, tagName, assets, null);
+
+ private async Task AddAssetsAsync(string owner, string repository, string tagName, IList assets, Release currentRelease)
{
if (assets?.Any() == true)
{
try
{
- var release = await _vcsProvider.GetReleaseAsync(owner, repository, tagName).ConfigureAwait(false);
+ var release = currentRelease ?? await _vcsProvider.GetReleaseAsync(owner, repository, tagName).ConfigureAwait(false);
foreach (var asset in assets)
{
diff --git a/src/GitReleaseManager.IntegrationTests/GitReleaseManager.IntegrationTests.csproj b/src/GitReleaseManager.IntegrationTests/GitReleaseManager.IntegrationTests.csproj
index ec77e555..da514e15 100644
--- a/src/GitReleaseManager.IntegrationTests/GitReleaseManager.IntegrationTests.csproj
+++ b/src/GitReleaseManager.IntegrationTests/GitReleaseManager.IntegrationTests.csproj
@@ -1,4 +1,4 @@
-
+
8.0
net472;netcoreapp3.1;net6.0
@@ -13,7 +13,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
@@ -21,11 +21,11 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/GitReleaseManager.Tests/GitReleaseManager.Tests.csproj b/src/GitReleaseManager.Tests/GitReleaseManager.Tests.csproj
index 83e05a39..ec842eac 100644
--- a/src/GitReleaseManager.Tests/GitReleaseManager.Tests.csproj
+++ b/src/GitReleaseManager.Tests/GitReleaseManager.Tests.csproj
@@ -13,21 +13,19 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
-
-
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
-
-
+
+
+
\ No newline at end of file
diff --git a/src/GitReleaseManager.Tool/GitReleaseManager.Tool.csproj b/src/GitReleaseManager.Tool/GitReleaseManager.Tool.csproj
index cd7e0439..d4d31ecd 100644
--- a/src/GitReleaseManager.Tool/GitReleaseManager.Tool.csproj
+++ b/src/GitReleaseManager.Tool/GitReleaseManager.Tool.csproj
@@ -31,15 +31,15 @@
-
-
-
+
+
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
-
+
diff --git a/src/GitReleaseManager.sln b/src/GitReleaseManager.sln
index e4b67429..a92435e5 100644
--- a/src/GitReleaseManager.sln
+++ b/src/GitReleaseManager.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29519.181
+# Visual Studio Version 17
+VisualStudioVersion = 17.6.33801.468
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitReleaseManager.Tests", "GitReleaseManager.Tests\GitReleaseManager.Tests.csproj", "{FAD045A3-CF63-48CA-BA49-8F4D79E3EF4F}"
EndProject