Add Github actions release CI (#2505)

Co-authored-by: shaunak_deshmukh <shaunak@infracloud.io>
This commit is contained in:
Shaunak Deshmukh
2022-08-18 16:08:39 +05:30
committed by GitHub
co-authored by shaunak_deshmukh
parent 63c1c25fda
commit a3fde534e2
3 changed files with 76 additions and 7 deletions
+7 -3
View File
@@ -39,14 +39,17 @@ check_clean() {
}
check_github_token() {
if [ ! -f "$HOME"/.github-token ]; then
echo "Error finding github access token at ${HOME}/.github-token"
if [ ! -f "$HOME"/.github-token ] && [ -z "$GITHUB_TOKEN" ]; then
echo "Error finding github access token at ${HOME}/.github-token or in GITHUB_TOKEN envvar"
exit 1
fi
echo "check_github_token == PASSED"
}
export GITHUB_TOKEN=$(cat ~/.github-token)
# Read token from file if not set as envvar
if [ -z "$GITHUB_TOKEN"]; then
export GITHUB_TOKEN=$(cat ~/.github-token)
fi
version=$1
if [ -z "$version" ]; then
@@ -66,6 +69,7 @@ check_github_token
export GORELEASER_CURRENT_TAG=$version
echo "Release version $GORELEASER_CURRENT_TAG "
echo "DOCKER_CLI_EXPERIMENTAL $DOCKER_CLI_EXPERIMENTAL"
goreleaser release
echo "############ DONE #############"