Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I programmatically upload a file to a github repo's Downloads area?

Tags:

git

github

ant

I have an ANT build which creates files (zip, jar, etc). I wish to push these files to my github repo's "Downloads" area, either via Tasks available to me with ANT (I've tried scp to no avail), via Jenkins (I've tried "Publish over SSH", to no avail) or some other means.

Thanks for guidance.

like image 650
marc esher Avatar asked Feb 19 '23 13:02

marc esher


1 Answers

That means using the GitHub V3 API in order to:

  • create a download entry on your GitHub repo download page
  • upload the file to S3

See those ruby scripts as a practical example of how this API is used:
"lib/octokit/client/downloads.rb".

If you need to do it from ant though, you could consider the HTTP-Post task of ant-contrib.
Or have your ant script calls commands like "HTTPie: cURL for Humans"
Or use directly Jenkins, as in "Connect Github to secured Jenkins via HTTP Post-Commit Hook"

like image 183
VonC Avatar answered Feb 22 '23 01:02

VonC