Skip to content

Commit

Permalink
chore: wtf github
Browse files Browse the repository at this point in the history
  • Loading branch information
joelday committed Dec 30, 2022
1 parent 8f64dd9 commit 1a384ce
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,32 @@ public void UpdatePyroCli()
return;
}

var client = new Octokit.GitHubClient(new Octokit.ProductHeaderValue("Papyrus-Lang-CI"));
if (githubToken != null)
{
client.Credentials = new Octokit.Credentials(githubToken);
}
// TODO: Switch back to using Octokit after the rate limit expires (unauthenticated or not.)
var pyroCliZip = DownloadFile("https://github.com/fireundubh/pyro/releases/download/1656807840/pyro-master-1656807840.zip");
Unzip(pyroCliZip, pyroCliDirectory);

client.Repository.Release.GetAll("fireundubh", "pyro").ContinueWith((task) =>
{
var latestRelease = task.Result.First();
Information("Pyro update complete.");

// var client = new Octokit.GitHubClient(new Octokit.ProductHeaderValue("Papyrus-Lang-CI"));
// if (githubToken != null)
// {
// client.Credentials = new Octokit.Credentials(githubToken);
// }

// client.Repository.Release.GetAll("fireundubh", "pyro").ContinueWith((task) =>
// {
// var latestRelease = task.Result.First();

Information("Found latest release: " + latestRelease.Name);
// Information("Found latest release: " + latestRelease.Name);

var latestReleaseAsset = latestRelease.Assets.First();
var downloadUrl = latestReleaseAsset.BrowserDownloadUrl;
// var latestReleaseAsset = latestRelease.Assets.First();
// var downloadUrl = latestReleaseAsset.BrowserDownloadUrl;

var pyroCliZip = DownloadFile(downloadUrl);
Unzip(pyroCliZip, pyroCliDirectory);
// var pyroCliZip = DownloadFile(downloadUrl);
// Unzip(pyroCliZip, pyroCliDirectory);

Information("Pyro update complete.");
}).Wait();
// Information("Pyro update complete.");
// }).Wait();
}

public void DownloadCompilers() {
Expand Down

0 comments on commit 1a384ce

Please sign in to comment.