Skip to content

Commit

Permalink
try a workaround to get tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabiano Arruda committed May 3, 2020
1 parent 557df4d commit bb47191
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,35 @@
versionFile=$1
packageVersion=$2

# workaround while we try to discover how to the get the
# git tags within git action environment
function getLatestTag() {
echo "cloning into the temp folder"
mkdir temp && cd temp || exit 1
git clone git@github.com:azure-open-tools/event-hubs-cli.git
cd event-hubs-cli || exit 1
git fetch --all
}

function deleteTempFolder() {
echo "deleting temp folder"
cd ../../
rm -rf temp/
}

if [[ $versionFile == *"package"* ]];
then
version="$packageVersion"
else
version=$(go run "$versionFile")
fi

git fetch --all
echo "GitHubRef: $GITHUB_REF"
getLatestTag
checkTag=$(git --no-pager tag -l | grep "$version" | xargs)
if [[ $checkTag != "" ]];
then
echo "$checkTag already exist, skipping release."
deleteTempFolder
exit 0
fi

Expand All @@ -26,4 +42,6 @@ echo "New Version: $version"
echo "Latest Tag: $latestTag"
echo -e "Change Log Since Latest Tag: \n$changeLog"

hub release create -m "Azure Event Hubs Lib $version" -m "$changeLog" "$version"
hub release create -m "Azure Event Hubs Lib $version" -m "$changeLog" "$version"

deleteTempFolder

0 comments on commit bb47191

Please sign in to comment.