This repository was archived by the owner on Feb 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,28 @@ | ||
#!/bin/zsh | ||
|
||
#Fetch remote tags | ||
git fetch origin 'refs/tags/*:refs/tags/*' | ||
|
||
#Variables | ||
LAST_VERSION=$(git tag -l | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -n 1) | ||
NEXT_VERSION=$(echo $LAST_VERSION | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}') | ||
VERSION=${1-${NEXT_VERSION}} | ||
DEFAULT_MESSAGE="Release" | ||
MESSAGE=${2-${DEFAULT_MESSAGE}} | ||
RELEASE_BRANCH="release/$VERSION" | ||
|
||
# Commit uncommited changes | ||
git add . | ||
git commit -am $MESSAGE | ||
git push | ||
|
||
# Create release branch | ||
git checkout -b $RELEASE_BRANCH develop | ||
gulp build | ||
git add . | ||
git commit -am "Build $NEXT_VERSION" | ||
git push origin $RELEASE_BRANCH | ||
git push origin develop | ||
|
||
# Merge release branch in master | ||
# Merge develop branch in master | ||
git checkout master | ||
git merge $RELEASE_BRANCH | ||
|
||
# Merge release branch in develop | ||
git checkout develop | ||
git merge $RELEASE_BRANCH | ||
git push origin develop | ||
git merge develop | ||
|
||
# Tag and push master | ||
git checkout master | ||
git tag $VERSION | ||
git push origin master --tags | ||
|
||
# Remove release branch | ||
git branch -d $RELEASE_BRANCH | ||
|
||
# Return to develop | ||
git checkout develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters