Skip to content

Commit

Permalink
get build from store repo
Browse files Browse the repository at this point in the history
  • Loading branch information
nishinji committed Nov 19, 2024
1 parent 42770ff commit 4480dde
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 1 addition & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Copyright 2024 Vita3K
Copyright 2024 Vita3K-team

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Vita3KBot
A bot for the Vita3K Discord server.
20 changes: 10 additions & 10 deletions Vita3KBot/APIClients/GithubClient/GithubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ public static class GithubClient {
public static async Task<Embed> GetLatestBuild() {

GitHubClient github = new GitHubClient(new ProductHeaderValue("Vita3KBot"));
Release latestRelease = await github.Repository.Release.Get("Vita3k", "Vita3k", "continuous");
Release latestRelease = await github.Repository.Release.Get("Vita3K", "Vita3K-builds", "latest");
string releaseTime = $"Published at {latestRelease.PublishedAt:u}";
ReleaseAsset windowsRelease = latestRelease.Assets.Where(release => {
return release.Name.StartsWith("windows-latest");
return release.Name.EndsWith("windows.7z");
}).First();
ReleaseAsset linuxRelease = latestRelease.Assets.Where(release => {
return release.Name.StartsWith("ubuntu-latest");
return release.Name.EndsWith("ubuntu.7z");
}).First();
ReleaseAsset appimageRelease = latestRelease.Assets.Where(release => {
return release.Name.StartsWith("Vita3K-x86_64.AppImage");
return release.Name.EndsWith("Vita3K-x86_64.AppImage");
}).First();
ReleaseAsset macosRelease = latestRelease.Assets.Where(release => {
return release.Name.StartsWith("macos-latest");
return release.Name.EndsWith("macos.dmg");
}).First();

string commit = latestRelease.Body.Substring(latestRelease.Body.IndexOf(":") + 1).Trim();
commit = commit.Substring(0, commit.IndexOf("\n"));
GitHubCommit REF = await github.Repository.Commit.Get("Vita3k", "Vita3k", commit);
Issue prInfo = await GetPRInfo(github, commit);
string commitSha = latestRelease.Body.Substring(latestRelease.Body.IndexOf("https://github.com/Vita3K/Vita3K/commit/") + 46).Trim();
commitSha = commitSha.Substring(0, commitSha.IndexOf(")"));
GitHubCommit REF = await github.Repository.Commit.Get("Vita3k", "Vita3k", commitSha);
Issue prInfo = await GetPRInfo(github, commitSha);

EmbedBuilder LatestBuild = new EmbedBuilder();
EmbedBuilder LatestBuild = new();
if (prInfo != null) {
LatestBuild.WithTitle($"PR: #{prInfo.Number} By {prInfo.User.Login}")
.WithUrl(prInfo.HtmlUrl);
Expand Down

0 comments on commit 4480dde

Please sign in to comment.