Gitea: Offer a download link to specific release file

Created on 23 Mar 2018  路  8Comments  路  Source: go-gitea/gitea

How about one-upping GitHub and offering a direct download link to any file from any release. The best way I can think of would be with the following URL scheme, I don't they could interfere with any current ones.

| URL | Download |
|---------------------------------------------------------|------------------------------------|
| /{user}/{repo}/releases/download/latest/{name} | name from latest stable release |
| /{user}/{repo}/releases/download/latest:stable/{name} | name from latest stable release |
| /{user}/{repo}/releases/download/latest:prerelease/{name} | name from latest prerelease |
| /{user}/{repo}/releases/download/tag:{tag}/{name} | name from specific release tag |

The URLs should 302 to the attachement URL, if no file or release exists it should 404. If you like the idea but have bigger priorities I could look into implementing it myself, though it will take some time since I've never contributed to a big project, nor used Go.

This is really useful to provide a static URL to the latest release similar to wordpress.org/latest.zip that can be used by scripts. Instead it would look more like /wordpress/wordpress/releases/download/latest/wordpress.zip.

kinproposal

Most helpful comment

If semantic versioning of tags is taken into account I like the idea

All 8 comments

I'm not sure how it could be handled when a release offers multiple files with the same name, but who does that anyway?

If semantic versioning of tags is taken into account I like the idea

/{user}/{repo}/releases/download/version:{constraint}/{name} would be pretty cool! I'm currently setting up the dev environment and hopefully I can implement this!

I'm currently working on this and am unsure how to "cleanly" tackle the problem of multiple attachements with the same name, do you think it would make sense to ban attachements with the same file name? If not any ideas of how to make every single attachement accessible, including files with the same name?

I think that attachments with same name should not be allowed

I request this or similar also please. i was using https://dl.gitea.io/gitea/master/gitea-master-linux-amd64 up until very recently, now it no longer exists, so my weekly update script no longer works.

@meoso it will be back soon again, we did move over infra to larger disk space, so not everything is back. As soon as our drone instance will be fully working again master downloads will be available again

I think it should also be integrated into the API.
Is there any news ?

Was this page helpful?
0 / 5 - 0 ratings