forked from bazelment/lrte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to upload generated package to github release page.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |