Last active
June 15, 2016 16:40
-
-
Save simonewebdesign/3ea8a7028c12fb71816a1308b06aeb86 to your computer and use it in GitHub Desktop.
Build and release a git repo, based on VERSION file
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 | |
## | |
# This script creates a new release by reading from VERSION file. | |
## | |
set -e # Exit on error | |
set +x # Debug mode (-x on, +x off) | |
version="$(cat VERSION)" | |
release="Release $version" | |
ls | grep -v build | xargs rm -Rf # remove all but build | |
mv build/* . | |
git add --all | |
git commit -m "$release" | |
git tag -a "$version" -m "$release" | |
git push origin releases --tags | |
echo "$release successful" | |
git reset --hard HEAD^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment