MattEqualsCoder.GitHubReleaseChecker 1.1.2

dotnet add package MattEqualsCoder.GitHubReleaseChecker --version 1.1.2                
NuGet\Install-Package MattEqualsCoder.GitHubReleaseChecker -Version 1.1.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MattEqualsCoder.GitHubReleaseChecker" Version="1.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MattEqualsCoder.GitHubReleaseChecker --version 1.1.2                
#r "nuget: MattEqualsCoder.GitHubReleaseChecker, 1.1.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MattEqualsCoder.GitHubReleaseChecker as a Cake Addin
#addin nuget:?package=MattEqualsCoder.GitHubReleaseChecker&version=1.1.2

// Install MattEqualsCoder.GitHubReleaseChecker as a Cake Tool
#tool nuget:?package=MattEqualsCoder.GitHubReleaseChecker&version=1.1.2                

GitHub Release Checker

Small Nuget package for getting the finding the latest release on GitHub and comparing a provided version with.

  1. Version checking is based on Semantic Versioning
    • It should also work with flexible dot number notations (e.g., 1.2.3.1 will record as newer than 1.2.3 as well as 1.2.3.0)
  2. GitHub tags need to match the version (v is removed from the beginning)
  3. Only the most recent 10 releases are checked
  4. Built to be used with Dependency Injection
  5. It should be compatible with the .net build versioning that includes the git commit
    • Note that if the GitHub tags don't include the git commit in them, then it will treat 1.2.3+hash1 as equal to 1.2.3+hash2

Examples

Adding the services to a project

Host.CreateDefaultBuilder(e.Args)
.ConfigureLogging(...)
.ConfigureServices(services =>
{
    services.AddGitHubReleaseCheckerServices();
})
.Start();

Checking the release

var version = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);

var newerGitHubRelease = _host.Services.GetRequiredService<IGitHubReleaseCheckerService>()
    .GetGitHubReleaseToUpdateToAsync("MattEqualsCoder", "TestRepo", version ?? "", false);

if (newerGitHubRelease != null)
{
    var response = MessageBox.Show("A new update was found! Do you want to go to the release page?", "New Update",
        MessageBoxButton.YesNo);

    if (response == MessageBoxResult.Yes)
    {
        var url = newerGitHubRelease.Url.Replace("&", "^&");
        Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
    }
}
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MattEqualsCoder.GitHubReleaseChecker:

Package Downloads
MattEqualsCoder.MSURandomizer.Avalonia

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 1,049 12/22/2023
1.1.1 117 12/22/2023
1.1.0 110 12/22/2023
1.0.0 544 8/1/2023