feat(releases): add SelfUpdater installer-asset matching

This commit is contained in:
mika kuns
2026-04-23 14:38:20 +02:00
parent 5b4cdd366e
commit ba0b38b4f1
3 changed files with 69 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
using System.Text.RegularExpressions;
namespace ClaudeDo.Releases;
public static partial class SelfUpdater
{
[GeneratedRegex(@"^ClaudeDo\.Installer-(?<version>[\d\.]+)\.exe$", RegexOptions.IgnoreCase)]
private static partial Regex InstallerAssetRegex();
public static InstallerAssetMatch? FindInstallerAsset(IEnumerable<ReleaseAsset> assets)
{
foreach (var asset in assets)
{
var m = InstallerAssetRegex().Match(asset.Name);
if (m.Success)
{
return new InstallerAssetMatch(asset, m.Groups["version"].Value);
}
}
return null;
}
}