以编程方式将文件添加到GitHub下载页面 [英] Programmatically add files to a GitHub download page

查看:90
本文介绍了以编程方式将文件添加到GitHub下载页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<请注意,自从这个问题首次被问到后,Github发生了很大的变化,而不是下载页面阅读新版本。]]



我生成PDF文档作为我的项目的一部分,我希望它们保持与我的同步Git仓库(人们并不总是可以自己构建自己的仓库,因为他们经常使用专有字体)。



然而,将PDF添加到因为它是派生文件;此外,这样做会显着增加提交的大小和整个存储库的大小。



是否可以通过编程方式将文件发送到GitHub下载页面? (我知道标记的提交会自动添加到 git push --tags ,但我不知道这是在哪里记录的。我想我可以通过添加一个单独的分支只包含PDF本身 - 就像GitHub用户页面所做的那样 - 但是在使用Git的时候,我有点生疏。)

Github API v3支持此功能



GitHub还根据 maven插件基于<一个href =https://github.com/eclipse/egit-github/tree/master/org.eclipse.egit.github.core =nofollow noreferrer> java API ,它是用于GitHub的Eclipse Mylyn连接器



有一个名为 github_api



另一个答案是关于net-github-upload可用于 perl ruby​​


[[Please note that Github has changed a lot since this question was first asked; instead of "download page" read "new release".]]

I generate PDF documentation as part of my projects and I'd like them to stay in sync with my Git repository (it's not always possible for people to build their own since they often use proprietary fonts).

However, it's not really "correct" to add the PDFs to the repository since it's a derived file; furthermore, doing this adds significantly to the size of the commits and the size of the repository overall.

Is it possible to programmatically send files to the GitHub download page? (I know that tagged commits are automatically added there with git push --tags but I don't know where this is documented. I suppose I could do something fancy by adding a separate branch only containing the PDFs themselves — as done by the GitHub user pages — but I'm a bit rusty on using Git this way.)

解决方案

Github API v3 supports this feature.

GitHub also provides a maven plugin based on the java API that is part of the Eclipse Mylyn connector for GitHub.

There is a ruby gem called github_api.

The other answer talks about net-github-upload which is available for perl and ruby.

这篇关于以编程方式将文件添加到GitHub下载页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆