forked from tchen0123/supergiant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush_release.sh
More file actions
executable file
·34 lines (27 loc) · 1.17 KB
/
push_release.sh
File metadata and controls
executable file
·34 lines (27 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
echo "building release artifacts"
PROJECTDIR=${TRAVIS_HOME}/gopath/src/github.com/${TRAVIS_REPO_SLUG}
echo ${PROJECTDIR}
mkdir -p ./supergiant-build
cp -avr ${PROJECTDIR}/templates/ ./supergiant-build
cp -avr ${PROJECTDIR}/cmd/ui/assets/dist/ ./supergiant-build
chmod +x ./supergiant-build/controlplane
ls -la ./supergiant-build
tar -czpf dist/assest.gz ./supergiant-build
# 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" dist/;;
*beta* ) echo "Releasing version: ${TAG}, as pre-release"
ghr --username supergiant --token "$GITHUB_TOKEN" --replace -b "pre-release" --prerelease --debug "$TAG" dist/;;
*)echo "Releasing version: ${TAG}, as latest release."
ghr --username supergiant --token "$GITHUB_TOKEN" --replace -b "latest release" --debug "$TAG" dist/;;
esac
# Check for errors
if [ $? -eq 0 ]; then
echo "Release pushed"
else
echo "Push to releases failed"
exit 1
fi