private async Task IncrementVersionAsync(VersionScope scope) { if (!await WaitForInterfaceAsync()) { return; } switch (scope) { case VersionScope.Major: Interface.Version.IncrementMajor(); break; case VersionScope.Minor: Interface.Version.IncrementMinor(); break; case VersionScope.Release: Interface.Version.IncrementRelease(); break; case VersionScope.Build: Interface.Version.IncrementBuild(); break; } if (scope != VersionScope.Build) { IsRelease = true; } await Interface.SaveVersionAsync(); Result = $"Incremented {scope.ToString()}: {Interface.Version.ToString()}"; }
/// <summary> /// Release Versions (Major, Minor, Release) should be triggered after manual input from user. /// Build version should be triggered from Build events /// </summary> /// <param name="scope"></param> public async Task IncrementVersionAndCommitChangesAsync(VersionScope scope) { if (!await WaitForInterfaceAsync()) { Result = "Failed to update version."; return; } //Update Project Version await IncrementVersionAsync(scope); bool isRelease = false; if (isRelease) { //Switch project to RELEASE } //Build project with updated version //Return if not committing changes switch (scope) { case VersionScope.Build when !CommitOnBuildUpdates: return; case VersionScope.Release when !CommitOnReleaseUpdates: return; } await CommitChangesAsync($"{scope.ToString()} Release"); }