diff options
author | Allan Wang <me@allanwang.ca> | 2020-02-18 00:19:26 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2020-02-18 00:19:26 -0800 |
commit | 402e98a7c79964449b6c235df1a6a19d709a57ec (patch) | |
tree | a0b72315355964113648c4e83cf7679a92a17e40 | |
parent | 0fbf49e583388ea924d8d0cd9374023c33f67a78 (diff) | |
download | frost-402e98a7c79964449b6c235df1a6a19d709a57ec.tar.gz frost-402e98a7c79964449b6c235df1a6a19d709a57ec.tar.bz2 frost-402e98a7c79964449b6c235df1a6a19d709a57ec.zip |
Use auth headers for github api key
-rwxr-xr-x | generate-apk-release.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generate-apk-release.sh b/generate-apk-release.sh index c9b44358..a1438a6c 100755 --- a/generate-apk-release.sh +++ b/generate-apk-release.sh @@ -44,7 +44,7 @@ git push -fq origin master > /dev/null echo "Create New Release" API_JSON="$(printf '{"tag_name": "v%s","target_commitish": "master","name": "v%s","body": "Automatic Release v%s for branch %s %s","draft": false,"prerelease": false}' ${TRAVIS_BUILD_NUMBER} ${TRAVIS_BUILD_NUMBER} ${TRAVIS_BUILD_NUMBER} "\`${TRAVIS_BRANCH}\`" "\nhttps://github.com/${TRAVIS_REPO_SLUG}/commit/${TRAVIS_COMMIT}")" -newRelease="$(curl --data "${API_JSON}" https://api.github.com/repos/${RELEASE_REPO}/releases?access_token=${GITHUB_API_KEY})" +newRelease="$(curl --data "${API_JSON}" -H "Authorization: token ${GITHUB_API_KEY}" https://api.github.com/repos/${RELEASE_REPO}/releases)" rID="$(echo "$newRelease" | jq ".id")" cd ${HOME}/${VERSION_KEY} @@ -52,7 +52,7 @@ echo "Push apk to $rID" for apk in $(find *.apk -type f); do apkName="${apk::-4}" printf "Apk $apkName\n" - curl "https://uploads.github.com/repos/${RELEASE_REPO}/releases/${rID}/assets?access_token=${GITHUB_API_KEY}&name=${apkName}-v${TRAVIS_BUILD_NUMBER}.apk" --header 'Content-Type: application/zip' --upload-file ${apkName}.apk -X POST + curl -H "Authorization: token ${GITHUB_API_KEY}" "https://uploads.github.com/repos/${RELEASE_REPO}/releases/${rID}/assets?name=${apkName}-v${TRAVIS_BUILD_NUMBER}.apk" --header 'Content-Type: application/zip' --upload-file ${apkName}.apk -X POST done echo -e "Done\n"
\ No newline at end of file |