2

Im trying to upload zip file to github repository using github api. Sometimes to upload zip in particular branch. But all fails.

Try 1

curl -XPOST -H "Authorization:token XYZ” -H "Content-Type:application/octet-stream" --data-binary @myfile.ipa https://uploads.github.com/repos/username/Test/releases/1/assets?name=myfile.ipa

I get Response as

{"message":"Not Found","request_id”:”AAA:BBB:CCCC:DDDD:EEEEEE”,”documentation_url":"https://developer.github.com/v3"}

Try 2

curl -XPOST -H "Authorization:token XYZ" -H "Content-Type:multipart/form-data" --data-binary @myfile.ipa.zip https://api.github.com/repos/username/Test/contents/myfile.ipa.zip?ref=particular_branch_name

Response

{"message":"Error","request_id”:”AAA:BBB:CCCC:DDDD:EEEEEE”,”documentation_url":"https://developer.github.com/v3"}

Try 3

curl -XPOST -H "Authorization:token XYZ" -H "Content-Type:multipart/form-data" --data-binary @myfile.ipa.zip https://uploads.github.com/repos/username/Test/contents/NEWFOLDER/@myfile.ipa.zip?ref=particular_branch_name

Response

{"message":"Not Found","request_id”:”AAA:BBB:CCCC:DDDD:EEEEEE”,”documentation_url":"https://developer.github.com/v3"}

I test this in terminal. To check whether it works. Before adding it as script in “Post Build Task plugin” at “post-build actions” in Jenkins.

xemeg
  • 21
  • 1
  • 2
    Are you trying to upload this as a release asset or as a part of the repository? If the latter, it's not generally recommended to store zip files in repositories. – bk2204 Apr 30 '20 at 23:13
  • Thanks! I want to upload as part of the repository. But Now I tried with release asset and it uploaded successfully. Previously just because i didnt create release(to get id as response) it failed. Now Im trying with upload ipa file instead of zip one, as part of the repository. – xemeg May 04 '20 at 09:43

0 Answers0