Sha256: 889e7ecfaca39d6f3875a7b3d1fc1de1eaf34ff659766e97aab6a77fd9ac0535

Contents?: true

Size: 1.09 KB

Versions: 6

Compression:

Stored size: 1.09 KB

Contents

require 'active_support/core_ext'

namespace :gem do
  desc "Bump gem version, push to RubyGems, push to Github, add release notes"
  task :release, [:version] do |_, args|
    version = args[:version] || 'rc'
    old_version = gem_version

    sh! "gem bump --version #{version} --no-commit"
    sh! "git add lib/cf/version.rb"

    print_with_purpose "Bumping to version #{gem_version}"
    #generate_release_notes(old_version)
    sh!("git commit -m 'Bumping to version #{gem_version}.'")
    sh!("git push")
    sh!("gem release --tag")
  end

  private
  #def generate_release_notes(old_version)
  #  print_with_purpose "Generating release notes..."
  #  file_name = "release_#{gem_version}"
  #  sh!("anchorman notes --name=#{file_name} --from=v#{old_version}")
  #  sh!("git add release_notes")
  #end

  def sh!(cmd)
    `#{cmd}`
    raise "borked with #{$?}" unless $?.success?
  end

  def print_with_purpose(text)
    puts "\033[34m#{text}\033[0m"
  end

  def gem_version
    silence_warnings do
      load "lib/cf/version.rb"
    end
    Gem::Specification.load("cf.gemspec").version.to_s
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cf-5.2.1.rc7 lib/tasks/gem_release.rake
cf-5.2.1.rc6 lib/tasks/gem_release.rake
cf-5.2.1.rc5 lib/tasks/gem_release.rake
cf-5.2.1.rc4 lib/tasks/gem_release.rake
cf-5.2.1.rc3 lib/tasks/gem_release.rake
cf-5.2.1.rc2 lib/tasks/gem_release.rake