Skip to content

Instantly share code, notes, and snippets.

@simonewebdesign
Last active June 15, 2016 16:40
Show Gist options
  • Save simonewebdesign/3ea8a7028c12fb71816a1308b06aeb86 to your computer and use it in GitHub Desktop.
Save simonewebdesign/3ea8a7028c12fb71816a1308b06aeb86 to your computer and use it in GitHub Desktop.
Build and release a git repo, based on VERSION file
#!/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