File: release

package info (click to toggle)
ruby-version-sorter 2.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 164 kB
  • ctags: 39
  • sloc: ansic: 191; ruby: 99; sh: 48; makefile: 8
file content (23 lines) | stat: -rwxr-xr-x 578 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
# Edit the version string in the gemspec, then execute this script to:
#
# 1. Commit the version change
# 2. Tag the release
# 3. Push the tag and the current branch to GitHub
# 4. Publish the gem to RubyGems
#
set -e

gem build *.gemspec | awk '/Name:|Version:|File:/ { print $2 }' | xargs | {
  read gem_name gem_version gem_file
  trap "rm -rf $gem_file" INT EXIT

  bundle install
  script/test

  git commit -m "$gem_name $gem_version" -- *.gemspec Gemfile*
  git tag "v${gem_version}"

  git push origin HEAD "v${gem_version}"
  gem push "$gem_file"
}