chore: improves next version selection
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<PackageId>Novaloop.UpdateTag</PackageId>
|
||||
<title>Updates the tag of a repo to the next chosen version according the semver symantic.</title>
|
||||
<PackageTags>semver;update-tag;tag;git</PackageTags>
|
||||
<Version>0.1.4</Version>
|
||||
<Version>0.1.5</Version>
|
||||
<Authors>Matthias Langhard</Authors>
|
||||
<Company>Novaloop AG</Company>
|
||||
<PackageProjectUrl>https://gitlab.com/novaloop-oss/novaloop.update-tag</PackageProjectUrl>
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace Application.Models
|
||||
return nextVersion;
|
||||
}
|
||||
|
||||
public Version CreateRc()
|
||||
public Version CreatePatchRc()
|
||||
{
|
||||
if (Rc != null)
|
||||
{
|
||||
@@ -149,6 +149,36 @@ namespace Application.Models
|
||||
}
|
||||
|
||||
var nextVersion = Copy();
|
||||
nextVersion.Patch++;
|
||||
nextVersion.Rc = 0;
|
||||
return nextVersion;
|
||||
}
|
||||
|
||||
public Version CreateMinorRc()
|
||||
{
|
||||
if (Rc != null)
|
||||
{
|
||||
throw new ArgumentException("Cannot create RC. Already an RC.");
|
||||
}
|
||||
|
||||
var nextVersion = Copy();
|
||||
nextVersion.Minor++;
|
||||
nextVersion.Patch = 0;
|
||||
nextVersion.Rc = 0;
|
||||
return nextVersion;
|
||||
}
|
||||
|
||||
public Version CreateMajorRc()
|
||||
{
|
||||
if (Rc != null)
|
||||
{
|
||||
throw new ArgumentException("Cannot create RC. Already an RC.");
|
||||
}
|
||||
|
||||
var nextVersion = Copy();
|
||||
nextVersion.Major++;
|
||||
nextVersion.Minor = 0;
|
||||
nextVersion.Patch = 0;
|
||||
nextVersion.Rc = 0;
|
||||
return nextVersion;
|
||||
}
|
||||
|
||||
@@ -14,10 +14,12 @@ namespace Application.Models
|
||||
}
|
||||
else
|
||||
{
|
||||
NextVersions.Add(new NextVersion("rc", currentVersion.CreateRc()));
|
||||
NextVersions.Add(new NextVersion("patch", currentVersion.NextPatch()));
|
||||
NextVersions.Add(new NextVersion("minor", currentVersion.NextMinor()));
|
||||
NextVersions.Add(new NextVersion("major", currentVersion.NextMajor()));
|
||||
NextVersions.Add(new NextVersion("patch-rc", currentVersion.CreatePatchRc()));
|
||||
NextVersions.Add(new NextVersion("minor-rc", currentVersion.CreateMinorRc()));
|
||||
NextVersions.Add(new NextVersion("minor-rc", currentVersion.CreateMajorRc()));
|
||||
NextVersions.Add(new NextVersion("patch ", currentVersion.NextPatch()));
|
||||
NextVersions.Add(new NextVersion("minor ", currentVersion.NextMinor()));
|
||||
NextVersions.Add(new NextVersion("major ", currentVersion.NextMajor()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user