github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/bin/upload-github (about) 1 #!/usr/bin/env bash 2 # 3 # Upload a release 4 # 5 # Needs github-release from https://github.com/aktau/github-release 6 7 set -e 8 9 REPO="rclone" 10 11 if [ "$1" == "" ]; then 12 echo "Syntax: $0 Version" 13 exit 1 14 fi 15 VERSION="$1" 16 if [ "$GITHUB_USER" == "" ]; then 17 echo 1>&2 "Need GITHUB_USER environment variable" 18 exit 1 19 fi 20 if [ "$GITHUB_TOKEN" == "" ]; then 21 echo 1>&2 "Need GITHUB_TOKEN environment variable" 22 exit 1 23 fi 24 25 echo "Making release ${VERSION}" 26 github-release release \ 27 --repo ${REPO} \ 28 --tag ${VERSION} \ 29 --name "rclone" \ 30 --description "Rclone - rsync for cloud storage. Sync files to and from many cloud storage providers." 31 32 for build in `ls build | grep -v current | grep -v testbuilds`; do 33 echo "Uploading ${build}" 34 base="${build%.*}" 35 parts=(${base//-/ }) 36 os=${parts[3]} 37 arch=${parts[4]} 38 39 github-release upload \ 40 --repo ${REPO} \ 41 --tag ${VERSION} \ 42 --name "${build}" \ 43 --file build/${build} 44 done 45 46 github-release info \ 47 --repo ${REPO} \ 48 --tag ${VERSION} 49 50 echo "Done"