37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using ReleaseUpdater;
|
|
|
|
namespace Updater.Test;
|
|
|
|
internal class Program
|
|
{
|
|
static async Task Main(string[] args)
|
|
{
|
|
|
|
string installPath = AppDomain.CurrentDomain.BaseDirectory;
|
|
string appExe = "RetailUpdatesBot.exe";
|
|
string updaterPath = Path.Combine(installPath, "Tools\\Updater.exe");
|
|
|
|
var url = "https://git.frigat.duckdns.org/api/v1/repos/automacon/RetailUpdatesBot/releases";
|
|
var APIKey = "0552a77699d7506711946fc71cc6635515726bd1"; //токен
|
|
|
|
SemVerService.TryParse("v0.1.2", out var v1);
|
|
Console.WriteLine($"v0.1.2 - {v1}");
|
|
SemVerService.TryParse(ReleaseUpdaterFacade.GetCurrentVersion(), out var v2);
|
|
Console.WriteLine($"{ReleaseUpdaterFacade.GetCurrentVersion()} - {v2}");
|
|
Console.WriteLine(SemVerService.Compare("v0.1.2", ReleaseUpdaterFacade.GetCurrentVersion()));
|
|
|
|
await ReleaseUpdaterFacade.UpdateAsync(
|
|
apiUrl: url,
|
|
token: APIKey,
|
|
installPath: installPath,
|
|
appExeName: appExe,
|
|
tempDirectory: Path.Combine(updaterPath, "Tools", "Temp"),
|
|
updaterExePath: updaterPath,
|
|
versionOrLatest: "latest",
|
|
assetMask: "RetailUpdatesBot-{version}.zip"
|
|
);
|
|
|
|
Console.ReadKey();
|
|
}
|
|
}
|