Skip to content

Instantly share code, notes, and snippets.

@simonewebdesign
Created October 26, 2016 10:49
Show Gist options
  • Save simonewebdesign/f3f09b6542c4e0d6ba63b8caaaae6e16 to your computer and use it in GitHub Desktop.
Save simonewebdesign/f3f09b6542c4e0d6ba63b8caaaae6e16 to your computer and use it in GitHub Desktop.
Create a new release on GitHub by reading from a 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