是否有指向 GitHub 的链接以下载最新版本的存储库中的文件? [英] Is there a link to GitHub for downloading a file in the latest release of a repository?
问题描述
使用GitHub的发布功能,可以提供下载链接已发布软件的特定版本.但是,每次发布时,gh-page 也需要更新.
Using GitHub's Release feature, it is possible to provide a link to download a specific version of the published software. However, every time a release is made, the gh-page also needs to be updated.
有没有办法获得指向特定文件的链接,无论是最新版本的软件是什么?
Is there a way to get a link to a specific file of whatever the latest version of a software is?
例如,这将是一个静态链接:
e.g., this would be a static link:
https://github.com/USER/PROJECT/releases/download/v0.0.0/package.zip
我想要的是:
https://github.com/USER/PROJECT/releases/download/latest/package.zip
注意:这个问题和GitHub 最新发布是这个问题特别要求访问文件,不是 GitHub 最新发布页面
NOTE: The difference between this question and GitHub latest release is that this question specifically asks for getting access to the file, not the GitHub latest release page
推荐答案
晚了几年,但我只是实现了一个简单的重定向来支持 https://github.com/USER/PROJECT/releases/latest/下载/package.zip
.那应该重定向到最新标记的 package.zip
发布资产.希望好用!
A few years late, but I just implemented a simple redirect to support https://github.com/USER/PROJECT/releases/latest/download/package.zip
. That should redirected to the latest tagged package.zip
release asset. Hope it's handy!
这篇关于是否有指向 GitHub 的链接以下载最新版本的存储库中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!