Skip to content

Commit

Permalink
#34 fixing env and release upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mageddo committed Oct 15, 2017
1 parent 654534b commit 7e72a0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions builder
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ REPO_URL=mageddo/dns-proxy-server

create_release(){
# release notes
DESC=$(cat RELEASE-NOTES.md | awk 'BEGIN {RS="|"} {print substr($0, 0, index(substr($0, 3), "###"))}' | sed ':a;N;$!ba;s/\n/\\\\n/g') && \
DESC=$(cat RELEASE-NOTES.md | awk 'BEGIN {RS="|"} {print substr($0, 0, index(substr($0, 3), "###"))}' | sed ':a;N;$!ba;s/\n/\\r\\n/g') && \
PAYLOAD='{
"tag_name": "%s",
"target_commitish": "%s",
Expand All @@ -17,7 +17,7 @@ create_release(){
"draft": false,
"prerelease": true
}'
PAYLOAD=$(printf "$PAYLOAD", '1.0' 'MASTER' '1.0' "$DESC")
PAYLOAD=$(printf "$PAYLOAD" $APP_VERSION $CURRENT_BRANCH $APP_VERSION "$DESC")
TAG_ID=$(curl -i -s -f -X POST "https://api.github.com/repos/$REPO_URL/releases?access_token=$REPO_TOKEN" \
--data "$PAYLOAD" | grep -o -E 'id": [0-9]+'| awk '{print $2}' | head -n 1)
}
Expand All @@ -31,8 +31,8 @@ case $1 in

setup-repository )
git remote remove origin && git remote add origin https://${REPO_TOKEN}@github.com/$REPO_URL.git
git checkout -b build_branch ${TRAVIS_BRANCH}
echo "> Repository added, travisBranch=${TRAVIS_BRANCH}"
git checkout -b build_branch ${CURRENT_BRANCH}
echo "> Repository added, travisBranch=${CURRENT_BRANCH}"

;;

Expand Down

0 comments on commit 7e72a0d

Please sign in to comment.