Unverified Commit 62f53e55 authored by Dima Brusilovsky's avatar Dima Brusilovsky Committed by GitHub
Browse files

build: add second tag with v for each release (#663)

parent 868b76f1
Showing with 9 additions and 3 deletions
+9 -3
......@@ -4,7 +4,7 @@ set -ex
MAJOR_VERSION=1
MINOR_VERSION=4
latestRcTag=$(git tag --sort=-version:refname | grep -E "^v${MAJOR_VERSION}\.${MINOR_VERSION}.[0-9]+-rc" | head -n 1 | grep --only-matching "^v${MAJOR_VERSION}\.${MINOR_VERSION}.[0-9]\+" || true)
latestRcTag=$(git tag --sort=-version:refname | grep -E "^${MAJOR_VERSION}\.${MINOR_VERSION}.[0-9]+-rc" | head -n 1 | grep --only-matching "^${MAJOR_VERSION}\.${MINOR_VERSION}.[0-9]\+" || true)
if [ "$latestRcTag" == "" ]; then
nextVersion=$MAJOR_VERSION.$MINOR_VERSION.0
......@@ -12,10 +12,11 @@ else
nextVersion=$(echo $latestRcTag | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')
fi
export DATREE_BUILD_VERSION=$nextVersion-rc
export DATREE_BUILD_VERSION=$nextVersion-rc-dima-test
echo $DATREE_BUILD_VERSION
git tag $DATREE_BUILD_VERSION -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
git tag v$DATREE_BUILD_VERSION -a -m "Generated tag with v from TravisCI for build $TRAVIS_BUILD_NUMBER"
git push --tags
curl -sL https://git.io/goreleaser | GORELEASER_CURRENT_TAG=$DATREE_BUILD_VERSION GO_BUILD_TAG=staging VERSION=v$GORELEASER_VERSION bash
......
......@@ -2,11 +2,16 @@
set -ex
release_tag=$RELEASE_VERSION
v_release_tag=v$release_tag
git checkout "$release_tag-rc"
git tag $release_tag -a -m "Generated tag from manual TravisCI for production build $TRAVIS_BUILD_NUMBER"
git push origin $release_tag # TODO: check if goreleaser pushes the tag itself (so no need to push here)
git tag $v_release_tag -a -m "Generated tag with v from manual TravisCI for production build $TRAVIS_BUILD_NUMBER"
git push origin $release_tag
git push origin $v_release_tag
export DATREE_BUILD_VERSION=$release_tag
echo $DATREE_BUILD_VERSION
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment