Created
November 7, 2014 16:17
-
-
Save rpappalax/4fd41015a5b982a46ab9 to your computer and use it in GitHub Desktop.
bash script to tag a release
This file contains hidden or 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
#!/bin/bash -e | |
if (( $# != 1 )); then | |
echo "Please specify the tag" | |
exit 1; | |
fi | |
MY_PROJECT_DIR=$(basename $(pwd)) | |
TAG=$1 | |
echo "Tagging..." | |
git tag -a $1 -m "Release $1" | |
echo "Make version..." | |
make version | |
echo "Creating tar package..." | |
cd .. | |
tar zcvf my-project-name-$1.tar.gz --exclude=.git --exclude=test --exclude=node_modules $MY_PROJECT_DIR | |
zip -r my-project-name-$1.zip --exclude=*.git* --exclude=*test* --exclude=*node_modules* $MY_PROJECT_DIR | |
cd $MY_PROJECT_DIR | |
echo "Pushing new tags..." | |
git push --tags | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment