forked from saheienko/capacity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush_release.sh
executable file
·23 lines (20 loc) · 953 Bytes
/
push_release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
echo "Compressing assests"
tar -czpf /tmp/assest.gz "${TRAVIS_HOME}"/gopath/src/github.com/"${TRAVIS_REPO_SLUG}"/
# if a tag has alpha or beta in the name, it will be released as a pre-release.
# if a tag does not have alpha or beta, it is pushed as a full release.
case "${TAG}" in
*alpha* ) echo "Releasing version: ${TAG}, as pre-release"
ghr --username supergiant --token "$GITHUB_TOKEN" --replace -b "pre-release" --prerelease --debug "$TAG" /tmp/assest.gz;;
*beta* ) echo "Releasing version: ${TAG}, as pre-release"
ghr --username supergiant --token "$GITHUB_TOKEN" --replace -b "pre-release" --prerelease --debug "$TAG" /tmp/assest.gz;;
*)echo "Releasing version: ${TAG}, as latest release."
ghr --username supergiant --token "$GITHUB_TOKEN" --replace -b "latest release" --debug "$TAG" /tmp/assest.gz;;
esac
# Check for errors
if [ $? -eq 0 ]; then
echo "Release pushed"
else
echo "Push to releases failed"
exit 1
fi