From fd081c4ad2870d58a26e0ff180e65818be814421 Mon Sep 17 00:00:00 2001 From: Dmitry Panin Date: Wed, 11 Dec 2013 23:58:00 +0400 Subject: [PATCH] hacking releases --- upload-binaries.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/upload-binaries.sh b/upload-binaries.sh index f688b8190..0b6a56b9c 100755 --- a/upload-binaries.sh +++ b/upload-binaries.sh @@ -29,3 +29,36 @@ if [ "$TRAVIS_BRANCH" == "alphas" ]; then echo -e "Done uploading\n" fi fi + + +if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then +if [ "$TRAVIS_BRANCH" == "releasing-master" ]; then + echo -e "Creating a release\n" + curl -X POST -H "Authorization: token ${GH_TOKEN}" \ + -d '{"tag_name": "master-'${TRAVIS_BUILD_NUMBER}'", "target_commitish": "master", "name": "Master branch release number '${TRAVIS_BUILD_NUMBER}'", "body": "Automatic release on master branch generated by Travis CI", "draft": false, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt + IDDI=`cat json.txt | jq '.id'` + + echo -e "Uploading Core resources\n" + curl -X POST -H "Authorization: token ${GH_TOKEN}" \ + -H "Accept: application/vnd.github.manifold-preview" \ + -H "Content-Type: application/zip" \ + --data-binary @core.zip \ + "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core-${TRAVIS_BUILD_NUMBER}.zip" + + echo -e "Uploading android package\n" + curl -X POST -H "Authorization: token ${GH_TOKEN}" \ + -H "Accept: application/vnd.github.manifold-preview" \ + -H "Content-Type: application/zip" \ + --data-binary @projects/mtg/Android/bin/Wagic-debug.apk \ + "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android-${TRAVIS_BUILD_NUMBER}.apk" + + echo -e "Uploading PSP package\n" + curl -X POST -H "Authorization: token ${GH_TOKEN}" \ + -H "Accept: application/vnd.github.manifold-preview" \ + -H "Content-Type: application/zip" \ + --data-binary @projects/mtg/psprelease.zip \ + "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp-${TRAVIS_BUILD_NUMBER}.zip" + + echo -e "Done uploading\n" +fi +fi \ No newline at end of file