fixing fn release script

This commit is contained in:
Travis Reeder
2017-06-13 11:14:34 -07:00
parent 9981004af3
commit 4a89f5648d

View File

@@ -30,12 +30,13 @@ echo "Version: $version"
# make dep
make release
tag = "fn-$version"
git add -u
git commit -m "fn tool: $version release [skip ci]"
# todo: might make sense to move this into it's own repo so it can have it's own versioning at some point
git tag -f -a "fn-$version" -m "fn version $version"
git tag -f -a $tag -m "fn version $version"
git push
git push origin "fn-$version"
git push origin $tag
# For GitHub
# url='https://api.github.com/repos/treeder/functions/releases'
@@ -57,9 +58,9 @@ output=$(curl --request POST --form "file=@fn.exe" --header "PRIVATE-TOKEN: $GIT
win_markdown=$(echo "$output" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["markdown"]')
# 2) Create a release: https://docs.gitlab.com/ee/api/tags.html#create-a-new-release
release_url="https://gitlab-odx.oracle.com/api/v3/projects/9/repository/tags/$version/release"
release_url="https://gitlab-odx.oracle.com/api/v3/projects/9/repository/tags/$tag/release"
release_desc="Amazing release. Wow\n\nfn for Linux: $linux_markdown \n\nfn for Mac: $mac_markdown \n\nfn for Windows: $win_markdown"
curl --request POST -H "PRIVATE-TOKEN: $GITLAB_TOKEN" -H "Content-Type: application/json" -d "{\"tag_name\": \"$version\", \"description\": \"$release_desc\"}" $release_url
curl --request POST -H "PRIVATE-TOKEN: $GITLAB_TOKEN" -H "Content-Type: application/json" -d "{\"tag_name\": \"$tag\", \"description\": \"$release_desc\"}" $release_url
# TODO: Add the download URLS to install.sh. Maybe we should make a template to generate install.sh
# TODO: Download URL's are in the output vars above under "url". Eg: "url":"/uploads/9a1848c5ebf2b83f8b055ac0e50e5232/fn.exe"