forked from iberianpig/fusuma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
43 lines (31 loc) · 1016 Bytes
/
Rakefile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'bump'
RSpec::Core::RakeTask.new(:spec)
task default: :spec
require 'github_changelog_generator/task'
desc 'bump version and generate CHANGELOG with the version'
task :bump, :type do |_, args|
label = args[:type]
unless %w[major minor patch pre].include?(label)
raise "Usage: rake bump[LABEL] (LABEL: ['major', 'minor', 'patch', 'pre'])"
end
next_version = Bump::Bump.next_version(label)
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.user = 'iberianpig'
config.project = 'fusuma'
config.future_release = next_version
end
Rake::Task[:changelog].execute
puts 'update CHANGELOG'
`git add CHANGELOG.md`
puts "Bump version to #{label}"
Bump::Bump.run(label)
puts 'Please check CHANGELOG.md'
puts 'Next step: "bundle exec rake release_tag"'
end
desc 'Create and Push tag'
task :release_tag do
Rake::Task['release:source_control_push'].invoke
end