Skip to content

Commit

Permalink
Add script to upload generated package to github release page.
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhaom committed Sep 27, 2015
1 parent 7575bea commit 6494ea5
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions upload-github-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Upload generated packages as github release
#
# Prerequisites:
# 1. github-release tool(https://github.com/aktau/github-release) is available in path.
# 2. Environment variables are set:
# - GITHUB_USER
# - GITHUB_TOKEN
# - RELEASE_TAG

function upload() {
local fname=$1
local name=$(basename ${fname})
echo "upload $fname"
github-release upload -r lrte -t ${RELEASE_TAG} -n ${name} -f ${fname}
}

function error() {
echo "$@"
exit 1
}

if [ -z $RELEASE_TAG ]; then
error "RELEASE_TAG environment variable needs to be set, like v2.0_0"
fi

set -e

for fname in $@; do
upload ${fname}
done
github-release info -r lrte -t ${RELEASE_TAG}

0 comments on commit 6494ea5

Please sign in to comment.