Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify release task #268

Open
bf4 opened this issue Oct 7, 2015 · 0 comments
Open

simplify release task #268

bf4 opened this issue Oct 7, 2015 · 0 comments

Comments

@bf4
Copy link
Member

bf4 commented Oct 7, 2015

https://github.com/github/scientist/blob/master/script/release

#!/bin/sh
# Tag and push a release.

set -e

# Make sure we're in the project root.

cd $(dirname "$0")/..

# Build a new gem archive.

rm -rf scientist-*.gem
gem build -q scientist.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 scientist-*.gem | sed 's/^scientist-\(.*\)\.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 scientist-*.gem && git tag "$tag" &&
  git push origin master && git push origin "$tag"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant