zyedidia / eget

Easily install prebuilt binaries from GitHub.
MIT License
836 stars 38 forks source link

Gitea support #61

Open jolheiser opened 1 year ago

jolheiser commented 1 year ago

It would be neat to use this with releases on a Gitea instance as well.

zyedidia commented 1 year ago

Could you point me to an example of some software hosted on Gitea so I can see what might be involved?

jolheiser commented 1 year ago

Sure! https://gitea.com/gitea/tea

Our API should be fairly similar to GH, so theoretically shouldn't be too much different aside from endpoints.

Of course, gitea is primarily for self hosting, so support would likely need to involve a way to specify some specific instance.

jolheiser commented 1 year ago

I would also be willing to assist or even contribute this feature if you're okay with a proposal. 🙂

zyedidia commented 1 year ago

Cool. It would be great to have Gitea support. I think it's unlikely I will implement it myself, but feel free to open a PR for it if you want. Maybe downloading from Gitea would require prefixing the repo with gitea.com. So it would be eget gitea.com/gitea/tea, for your example, or eget gitea.your.host/user/repo for custom hosted repos.

Hopefully it won't be too difficult to adapt the current code. You'll probably need to make a new GiteaAssetFinder in find.go, and then add some more parsing to getFinder in eget.go that will use the GiteaAssetFinder if it detects gitea in the hostname of the url, or something like that. Maybe if the custom host doesn't have gitea in the name, it would have to accept something like eget gitea/your.host/user/repo?