diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-09-15 14:06:10 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-09-15 14:06:10 -0300 |
commit | 70a3cb35f07da911ef4176a2b12d487afbc92d86 (patch) | |
tree | e5ef5ce09818c8e9bd7189be64182a779512c6d5 /docs/script/release | |
parent | ef3db8b0908cd59c405fe19df507512a68f9708f (diff) | |
download | PSP.git-70a3cb35f07da911ef4176a2b12d487afbc92d86.tar.gz PSP.git-70a3cb35f07da911ef4176a2b12d487afbc92d86.tar.xz PSP.git-70a3cb35f07da911ef4176a2b12d487afbc92d86.zip |
Add a lot of gh page files
Diffstat (limited to 'docs/script/release')
-rw-r--r-- | docs/script/release | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/script/release b/docs/script/release new file mode 100644 index 0000000..fb400aa --- /dev/null +++ b/docs/script/release @@ -0,0 +1,42 @@ +#!/bin/sh +# Tag and push a release. + +set -e + +# Make sure we're in the project root. + +cd $(dirname "$0")/.. + +# Make sure the darn thing works + +bundle update + +# Build a new gem archive. + +rm -rf jekyll-theme-cayman-*.gem +gem build -q jekyll-theme-cayman.gemspec + +# Make sure we're on the master branch. + +(git branch | grep -q 'master') || { + echo "Only release from the master branch." + exit 1 +} + +# Figure out what version we're releasing. + +tag=v`ls jekyll-theme-cayman-*.gem | sed 's/^jekyll-theme-cayman-\(.*\)\.gem$/\1/'` + +# Make sure we haven't released this version before. + +git fetch -t origin + +(git tag -l | grep -q "$tag") && { + echo "Whoops, there's already a '${tag}' tag." + exit 1 +} + +# Tag it and bag it. + +gem push jekyll-theme-cayman-*.gem && git tag "$tag" && + git push origin master && git push origin "$tag" |