Rakefile in gem_name-0.1.4 vs Rakefile in gem_name-0.1.5
- old
+ new
@@ -2,10 +2,14 @@
require "bundler/gem_tasks"
require "rake/testtask"
require_relative "lib/brew_lib"
+def version
+ `git describe --tags --abbrev=0`.chomp
+end
+
desc "Show all tasks in current Rakefile, to see descriptions rake -T or rake -D"
task :all do
Rake::Task.tasks.each do |task|
puts task.inspect
end
@@ -14,12 +18,14 @@
desc "Show tasks in current Rakefile, to see descriptions rake -T or rake -D"
task :tasks do
sh "rake", "--tasks"
end
+desc "Create a new release and push [patch|minor|major], default is patch"
task bump: [:test] do |t, args|
- raise = args.to_a.fetch(0, "minor")
- a = sh "git add -A && { git commit -m 'bump #{raise}' || true; } && gem bump --tag --push --release"
+ part = args.to_a.fetch(0, "patch")
+ sh "git add -A && { git commit --quiet -m 'bump #{part}' 2>/dev/null || true; } &&
+ gem bump --silent --quiet --tag --push --release && gh release create #{version} --generate-notes"
puts args.to_a.fetch(0, "minor")
end
Rake::TestTask.new(:test) do |t|
t.libs << "test"