Skip to content
Snippets Groups Projects
Commit 70d85ecd authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Update release.sh: should only be run on `dev` branch

parent 5382b813
Branches
Tags
No related merge requests found
#!/bin/bash #!/bin/bash
### Control that the script is run on `dev` branch
branch=`git rev-parse --abbrev-ref HEAD`
if [[ ! "$branch" = "dev" ]];
then
echo ">> This script must be run under \`dev\` branch"
exit
fi
### Releasing
current=`grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -oP "\d+.\d+.\d+(\w*)"` current=`grep -P "version\": \"\d+.\d+.\d+(\w*)" package.json | grep -oP "\d+.\d+.\d+(\w*)"`
echo "Current version: $current" echo "Current version: $current"
...@@ -47,7 +56,10 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ ]]; then ...@@ -47,7 +56,10 @@ if [[ $2 =~ ^[0-9]+.[0-9]+.[0-9]+((a|b)[0-9]+)?$ ]]; then
;; ;;
esac esac
git commit -m "v$2" git commit -m "v$2"
git checkout master
git merge dev
git tag "v$2" git tag "v$2"
git checkout dev
else else
echo "Wrong version format" echo "Wrong version format"
fi fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment