forked from jekyll/jekyll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.rake
30 lines (27 loc) · 959 Bytes
/
release.rake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true
#############################################################################
#
# Packaging tasks
#
#############################################################################
desc "Release #{name} v#{version}"
task :release => :build do
current_branch = `git branch`.to_s.strip.match(%r!^\* (.+)$!)[1]
unless current_branch == "master" || current_branch.end_with?("-stable")
puts "You must be on the master branch to release!"
exit!
end
sh "git commit --allow-empty -m 'Release :gem: #{version}'"
sh "git tag v#{version}"
sh "git push origin #{current_branch}"
sh "git push origin v#{version}"
sh "gem push pkg/#{name}-#{version}.gem"
puts "Do not forget to build and release the docs gem as well."
puts "https://github.com/jekyll/jekyll-docs#releasing"
end
desc "Build #{name} v#{version} into pkg/"
task :build do
mkdir_p "pkg"
sh "gem build #{gemspec_file}"
sh "mv #{gem_file} pkg"
end