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.