6 Commits
v0.4.0 ... main

Author SHA1 Message Date
4292758118 fix: fixes typo for major-rc 2022-03-28 10:08:16 +02:00
Markus Huggler
3ddf81bd1d chore: updates LibGit2Sharp to the preview version because OpenSSL 1.0 is removed from a lot of distros 2021-12-01 13:52:57 +01:00
Matthias Langhard
b6a4a8f8ec chore: bumps version number 2021-11-04 21:23:06 +01:00
Matthias Langhard
5e1dd98ecd deploy: runs tests only on tags 2021-11-04 21:22:49 +01:00
Matthias Langhard
7b7fafbce9 feat: implements spinner which runs when pushing tags / commits to remote 2021-11-04 21:20:41 +01:00
Matthias Langhard
8a8b16c655 feat: implements better commandline args parsing with '--version' and '--help' outputs 2021-11-04 21:13:40 +01:00
7 changed files with 35 additions and 8 deletions

View File

@@ -3,6 +3,8 @@ stages:
- publish
running tests for tag:
only:
- tags
image: mcr.microsoft.com/dotnet/sdk:5.0
stage: test
script:

View File

@@ -25,11 +25,18 @@ namespace Cli
var repoBasePath = await GetRepoBasePath(workingDir);
var chosenService = await ChooseService(repoBasePath);
var selection = await SelectVersion(repoBasePath, chosenService);
await AddVersionTagToRepo(repoBasePath, selection.Version.ToString());
await PushTagsToRemote(repoBasePath);
await PushCommitsToRemote(repoBasePath);
await AnsiConsole.Status()
.StartAsync("pushing to remote...", async _ =>
{
await AddVersionTagToRepo(repoBasePath, selection.Version.ToString());
await PushTagsToRemote(repoBasePath);
await PushCommitsToRemote(repoBasePath);
}
);
}
private async Task<string> GetRepoBasePath(string workingDir)
{
var repoBasePath = "";

View File

@@ -6,10 +6,11 @@
<RootNamespace>Cli</RootNamespace>
<PackAsTool>true</PackAsTool>
<ToolCommandName>update-tag</ToolCommandName>
<AssemblyTitle>update-tag</AssemblyTitle>
<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.4.0</Version>
<Version>0.6.1</Version>
<Authors>Matthias Langhard</Authors>
<Company>Novaloop AG</Company>
<PackageProjectUrl>https://gitlab.com/novaloop-oss/novaloop.update-tag</PackageProjectUrl>
@@ -18,6 +19,7 @@
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0"/>
<PackageReference Include="Spectre.Console" Version="0.42.0"/>

View File

@@ -0,0 +1,10 @@
using CommandLine;
namespace Cli.Models
{
public class CliParams
{
[Option('r', "repository-path", Required = false, HelpText = "Run update-tag on a git repository other than the current directory.")]
public string RepositoryPath { get; set; }
}
}

View File

@@ -1,7 +1,8 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Application;
using Cli.Models;
using CommandLine;
using Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@@ -21,9 +22,14 @@ namespace Cli
.ServiceProvider
.GetRequiredService<AppRunner>();
await appRunner.Run(args.FirstOrDefault() ?? Environment.CurrentDirectory);
await Parser.Default
.ParseArguments<CliParams>(args)
.WithParsedAsync(
async options => { await appRunner.Run(options.RepositoryPath ?? Environment.CurrentDirectory); }
);
}
private static IHostBuilder CreateHostBuilder()
{
return Host.CreateDefaultBuilder()

View File

@@ -16,7 +16,7 @@ namespace Application.Models
{
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("major-rc", currentVersion.CreateMajorRc()));
NextVersions.Add(new NextVersion("patch ", currentVersion.NextPatch()));
NextVersions.Add(new NextVersion("minor ", currentVersion.NextMinor()));
NextVersions.Add(new NextVersion("major ", currentVersion.NextMajor()));

View File

@@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="CliWrap" Version="3.3.3" />
<PackageReference Include="LibGit2Sharp" Version="0.26.2" />
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0158" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
<PackageReference Include="semver" Version="2.0.6" />
</ItemGroup>