Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Compare GitHub versions and download latest release assets.

License

Notifications You must be signed in to change notification settings

kalilistic/GitHub.ReleaseDownloader

Repository files navigation


GitHubReleaseDownloader
GitHub Release Downloader

Compare GitHub versions and download latest release assets.

Background

Small .NET framework library to compare versions and download the latest GitHub release.

Key Features

  • Check if current version is most recent using SemVer.
  • Download latest release artifacts from GitHub releases.
  • Include / exclude pre-releases.

How To Use

// create settings object
HttpClient httpClient = new HttpClient();
string author = "kalilistic";
string repo = "github.releasedownloader";
bool includePreRelease = true;
string downloadDirPath = "C:\assets";
IReleaseDownloaderSettings settings = new ReleaseDownloaderSettings(httpClient, author, repo, includePreRelease, downloadDirPath);

// create downloader
IReleaseDownloader downloader = new ReleaseDownloader(settings);

// check version
string currentVersion = "5.0.0";
bool isMostRecentVersion = downloader.IsLatestRelease(currentVersion);

// download latest github release
if (!isMostRecentVersion) {
  downloader.DownloadLatestRelease();
}

// clean up
downloader.DeInit();
httpClient.Dispose();

Considerations

  • Versions must be SemVer-compliant or exception will be thrown.
  • Will not compare and silently skip over GitHub releases that aren't Semver-compliant.
  • GitHub API calls are made anonymously and subject to rate limits.

How To Contribute

Feel free to open an issue or submit a PR.

About

Compare GitHub versions and download latest release assets.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages