Don Turner | 6ef7e0c | 2017-10-24 13:19:18 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | if [ "$#" -ne 1 ]; then |
| 4 | echo "Usage: upload_release.sh <release_version>" |
| 5 | exit 1; |
| 6 | fi |
| 7 | |
| 8 | if [ -z ${GITHUB_TOKEN} ]; then |
| 9 | echo "GITHUB_TOKEN not set. Please obtain a github developer token and set it using: \n\nexport GITHUB_TOKEN=<access token>" |
| 10 | exit 1; |
| 11 | fi |
| 12 | |
| 13 | RELEASE_VERSION=$1 |
| 14 | |
| 15 | pushd build |
| 16 | |
| 17 | GITHUB_RELEASE_BINARY=bin/darwin/amd64/github-release |
| 18 | |
| 19 | if [ ! -f ${GITHUB_RELEASE_BINARY} ]; then |
| 20 | |
| 21 | # Download and extract the github release tool |
| 22 | wget https://github.com/aktau/github-release/releases/download/v0.7.2/darwin-amd64-github-release.tar.bz2 -O darwin-amd64-github-release.tar.bz2 |
| 23 | tar xvjf darwin-amd64-github-release.tar.bz2 |
| 24 | fi |
| 25 | |
| 26 | if [ ! -f ${GITHUB_RELEASE_BINARY} ]; then |
| 27 | echo "Github release binary ${GITHUB_RELEASE_BINARY} does not exist." |
| 28 | exit 1; |
| 29 | fi |
| 30 | |
| 31 | |
| 32 | function upload_file(){ |
| 33 | echo "Uploading ${1}" |
| 34 | ${GITHUB_RELEASE_BINARY} upload --user google --repo oboe --tag ${RELEASE_VERSION} \ |
| 35 | --file upload/${1} --name ${1} |
| 36 | } |
| 37 | |
| 38 | upload_file cdep-manifest.yml |
| 39 | upload_file oboe-headers.zip |
| 40 | upload_file oboe-armeabi.zip |
| 41 | upload_file oboe-armeabi-v7a.zip |
| 42 | upload_file oboe-arm64-v8a.zip |
| 43 | upload_file oboe-x86.zip |
| 44 | upload_file oboe-x86_64.zip |
| 45 | upload_file oboe-mips.zip |
| 46 | |
| 47 | popd |