Check GitHub for a newer starter once a day, with a button to check now

The stable channel compares versions; the testing channel offers the staging
build of another commit. The channel switch is the starter's only, not the
simulator's.
This commit is contained in:
maj00r
2026-10-04 13:26:49 +02:00
parent a7a1e34239
commit 2b3c46938c
19 changed files with 777 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
using System.Threading;
using System.Threading.Tasks;
using StarterNG.Domain.Settings;
namespace StarterNG.Application.Abstractions;
/// <summary>
/// A published build of the starter: its tag, the page it is downloaded from and
/// the commit it was built from - the only way to tell rolling builds apart.
/// </summary>
public sealed record ReleaseInfo(string Tag, string PageUrl, string? Commit = null);
/// <summary>
/// What asking for the newest release came back with. No answer - offline, rate
/// limited, timed out - is kept apart from an answer of "nothing released", so a
/// failed check is not remembered as a done one.
/// </summary>
public sealed record ReleaseLookup(bool Answered, ReleaseInfo? Release)
{
public static ReleaseLookup NoAnswer { get; } = new(false, null);
public static ReleaseLookup Found(ReleaseInfo? release) => new(true, release);
}
public interface IReleaseFeed
{
Task<ReleaseLookup> LatestAsync(UpdateChannel channel, CancellationToken cancellationToken = default);
}