Skip to content

Instantly share code, notes, and snippets.

@rpappalax
Created November 7, 2014 16:17
Show Gist options
  • Save rpappalax/4fd41015a5b982a46ab9 to your computer and use it in GitHub Desktop.
Save rpappalax/4fd41015a5b982a46ab9 to your computer and use it in GitHub Desktop.
bash script to tag a release
#!/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