VersionChecker icon indicating copy to clipboard operation
VersionChecker copied to clipboard

[Feature]Adding support for GitHub releases.

Open ghost opened this issue 11 years ago • 12 comments

You easily can get GitHub releases info in JSON format using API link(like this). If mod uses proper versioning(like v1.7.10-1.0.0), then you can get the tag with latest version for 1.7.2 and compare it with current version of a mod. And you can fetch the body of a release and use it as a changelog. Also you can use the link to releases page as a download page one(if it wasn't set explicitly by a mod author).

ghost avatar Jul 11 '14 00:07 ghost

As much as I love the idea of using the github API. I think the author having to explicitly say "use these binaries" with use of the upload file may be safer. Author having more control over it.. But that said, nothing said a user HAS to use the github API way of doing the version control. But I guess this means the mod would HAVE to me open source, since if the repo is private you could not use the releases API.

WORMSS avatar Jul 11 '14 05:07 WORMSS

It should be optional what to use. For example, IMC message with another key for GitHub stuff.

ghost avatar Jul 11 '14 09:07 ghost

I like this idea, but I think this won't be used that often. I rarely see modders use GitHubs release system. I'd much rather have integration with CurseForge. @Kaelten said they are looking at adding some kind of API for modders, but no ETA ;)

Dynious avatar Jul 11 '14 09:07 Dynious

Funnily enough, I wrote a PHP script today to generate a version.json from a Github release using the Github API in preparation for adding Version Checker support to my mods.

Script: https://gist.github.com/squeek502/85ebca7c10f0ccf7bd6f

squeek502 avatar Jul 11 '14 10:07 squeek502

@anti344 as a Side note, you can still use the Github as a binary host, you could have a branch on github that holds nothing but a simple txt file. The normal "version_control.txt" you need upload to somewhere anyway. And then have it point to a github release url. I know it's not exactly what you wanted, but it is atleast something?

versioncontrol link

https:// raw.githubusercontent.com/{user}/{repo}/{releasebranch}/version_control.txt

direct link to file within version_control.txt

https:// github.com/{user}/{repo}/releases/download/{versionTag}/{mod.jar/mod.zip}

Here I have said {releasebranch} as I have kept the version_control.txt file off the master/development branch, and just have a completely different branch that does nothing but hold the file for reference.

WORMSS avatar Jul 11 '14 11:07 WORMSS

@WORMSS, that's what @Dynious does currently for his mods (version.json in the master branch). See: https://github.com/Dynious/VersionChecker/blob/master/version.json

squeek502 avatar Jul 11 '14 11:07 squeek502

@squeek502 looks to me @Dynious uses curseforge, not github releases.

WORMSS avatar Jul 11 '14 11:07 WORMSS

@WORMSS, he hosts the .json file (which you called version_control.txt above) on Github, exactly as you suggested. Where the binaries are hosted is irrelevant if there is a static/manually updated .json file pointing to them.

squeek502 avatar Jul 11 '14 11:07 squeek502

Don't get me wrong, if this is PR'ed I'll merge it, but just don't have the time to do this :(

Dynious avatar Jul 11 '14 12:07 Dynious

@squeek502 I was referring to the whole of the original question/issue. Not just the first part of it.

WORMSS avatar Jul 11 '14 12:07 WORMSS

@Dynious I have quite a lightweight github api library I can prob rip apart and tighten up to accommodate the issue.. I'l give it a look over on Sunday night, see what I can do. I think it currently works with AsyncTask as long as that will not be a problem in the MC environment.

WORMSS avatar Jul 11 '14 12:07 WORMSS

Why you need github api library if everything is in JSON an easily avaible?

ghost avatar Jul 11 '14 18:07 ghost