Add installer updater and server CLI

This commit is contained in:
Alexa
2026-05-27 20:54:53 +03:00
parent 4f44505759
commit 7852b410ee
25 changed files with 4153 additions and 703 deletions
+17 -1
View File
@@ -57,7 +57,7 @@ public sealed class ReleaseDownloader
var asset = await FindAssetAsync(
tagPrefix: version.ReleaseTagPrefix,
assetName: $"dorknet-server-{version.VersionKey}-win-x64.zip",
assetName: $"dorknet-server-{version.VersionKey}-{CurrentRid}.zip",
ct);
var zipPath = Path.Combine(AppPaths.LocalRoot, $"download-{Guid.NewGuid():N}.zip");
@@ -71,6 +71,22 @@ public sealed class ReleaseDownloader
return dir;
}
/// <summary>RID for asset naming — `win-x64`, `linux-x64`,
/// `linux-arm64`, `osx-x64`, `osx-arm64`. Matches the `-r` flag
/// the per-version release workflow passes to `dotnet publish`.</summary>
private static string CurrentRid =>
(OperatingSystem.IsWindows(), OperatingSystem.IsLinux(), OperatingSystem.IsMacOS(),
System.Runtime.InteropServices.RuntimeInformation.OSArchitecture) switch
{
(true, _, _, System.Runtime.InteropServices.Architecture.X64) => "win-x64",
(true, _, _, System.Runtime.InteropServices.Architecture.Arm64) => "win-arm64",
(_, true, _, System.Runtime.InteropServices.Architecture.X64) => "linux-x64",
(_, true, _, System.Runtime.InteropServices.Architecture.Arm64) => "linux-arm64",
(_, _, true, System.Runtime.InteropServices.Architecture.X64) => "osx-x64",
(_, _, true, System.Runtime.InteropServices.Architecture.Arm64) => "osx-arm64",
_ => "win-x64",
};
/// <summary>Returns the path to the unpacked client-patcher dir
/// for <paramref name="version"/>, downloading + caching if needed.</summary>
public async Task<string> EnsurePatcherAsync(