Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI version in main #1273

Merged
merged 6 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "src\\Polly.sln"
}
4 changes: 4 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
next-version: 8.0.0
branches:
main:
tag: v8alpha
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this based on our conversation yesterday, though the v8 prefix seems redundant to me.

1 change: 0 additions & 1 deletion GitVersionConfig.yaml

This file was deleted.

30 changes: 19 additions & 11 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ var nupkgDestDir = System.IO.Path.Combine(artifactsDir, Directory("nuget-package

// GitVersion
var gitVersionPath = ToolsExePath("GitVersion.exe");
var gitVersionConfigFilePath = "./GitVersionConfig.yaml";
var gitVersionConfigFilePath = "./GitVersion.yml";
Dictionary<string, object> gitVersionOutput;

// Versioning
string nugetVersion;
string assemblyVersion;
string assemblySemver;
string assemblyFileVersion;

// Stryker / Mutation Testing
var strykerConfig = File("./eng/stryker-config.json");
Expand Down Expand Up @@ -100,7 +100,13 @@ Task("__Clean")
foreach(var path in solutionPaths)
{
Information("Cleaning {0}", path);
DotNetClean(path.ToString());

var dotNetCleanSettings = new DotNetCleanSettings
{
Verbosity = DotNetVerbosity.Minimal,
};

DotNetClean(path.ToString(), dotNetCleanSettings);
}
});

Expand Down Expand Up @@ -151,17 +157,18 @@ Task("__UpdateAssemblyVersionInformation")
Information("NuGetVersion -> {0}", gitVersionOutput["NuGetVersion"]);
Information("FullSemVer -> {0}", gitVersionOutput["FullSemVer"]);
Information("AssemblySemVer -> {0}", gitVersionOutput["AssemblySemVer"]);
Information("MajorMinorPatch -> {0}", gitVersionOutput["MajorMinorPatch"]);
Information("CommitsSinceVersionSource -> {0}", gitVersionOutput["CommitsSinceVersionSource"]);

nugetVersion = gitVersionOutput["NuGetVersion"].ToString();
assemblyVersion = gitVersionOutput["Major"].ToString() + ".0.0.0";
assemblySemver = gitVersionOutput["AssemblySemVer"].ToString();
assemblyFileVersion = gitVersionOutput["MajorMinorPatch"].ToString() + "." + gitVersionOutput["CommitsSinceVersionSource"].ToString();

Information("");
Information("Mapping versioning information to:");
Information("NuGet package version -> {0}", nugetVersion);
Information("AssemblyVersion -> {0}", assemblyVersion);
Information("AssemblyFileVersion -> {0}", assemblySemver);
Information("AssemblyInformationalVersion -> {0}", assemblySemver);
Information("AssemblyFileVersion -> {0}", assemblyFileVersion);
});

Task("__BuildSolutions")
Expand All @@ -179,7 +186,7 @@ Task("__BuildSolutions")
MSBuildSettings = new DotNetMSBuildSettings
{
AssemblyVersion = assemblyVersion,
FileVersion = assemblySemver,
FileVersion = assemblyFileVersion,
TreatAllWarningsAs = MSBuildTreatAllWarningsAs.Error,
Version = nugetVersion,
},
Expand Down Expand Up @@ -230,7 +237,7 @@ Task("__RunMutationTests")
{
return;
}

TestProject(File("./src/Polly.Core/Polly.Core.csproj"), File("./src/Polly.Core.Tests/Polly.Core.Tests.csproj"), "Polly.Core.csproj");
TestProject(File("./src/Polly.RateLimiting/Polly.RateLimiting.csproj"), File("./src/Polly.RateLimiting.Tests/Polly.RateLimiting.Tests.csproj"), "Polly.RateLimiting.csproj");
TestProject(File("./src/Polly.Extensions/Polly.Extensions.csproj"), File("./src/Polly.Extensions.Tests/Polly.Extensions.Tests.csproj"), "Polly.Extensions.csproj");
Expand Down Expand Up @@ -261,7 +268,7 @@ Task("__RunMutationTests")
}
});

Task("__CreateSignedNuGetPackages")
Task("__CreateNuGetPackages")
.Does(() =>
{
var dotNetPackSettings = new DotNetPackSettings
Expand All @@ -272,8 +279,9 @@ Task("__CreateSignedNuGetPackages")
MSBuildSettings = new DotNetMSBuildSettings
{
AssemblyVersion = assemblyVersion,
FileVersion = assemblySemver,
FileVersion = assemblyFileVersion,
TreatAllWarningsAs = MSBuildTreatAllWarningsAs.Error,
PackageVersion = nugetVersion,
Version = nugetVersion,
},
};
Expand Down Expand Up @@ -302,7 +310,7 @@ Task("Build")
.IsDependentOn("__BuildSolutions")
.IsDependentOn("__RunTests")
.IsDependentOn("__RunMutationTests")
.IsDependentOn("__CreateSignedNuGetPackages");
.IsDependentOn("__CreateNuGetPackages");

///////////////////////////////////////////////////////////////////////////////
// PRIMARY TARGETS
Expand Down
2 changes: 1 addition & 1 deletion src/Polly.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
..\GitVersionConfig.yaml = ..\GitVersionConfig.yaml
..\GitVersion.yml = ..\GitVersion.yml
..\global.json = ..\global.json
..\README.md = ..\README.md
..\Version.props = ..\Version.props
Expand Down