-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
47 lines (36 loc) · 1.03 KB
/
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
44
45
46
47
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rspec/core/rake_task"
APP_RAKEFILE = "spec/internal/Rakefile"
load "rails/tasks/engine.rake"
RSpec::Core::RakeTask.new
def current_version
Semantic::Version.new(PagesCore::VERSION)
end
def write_version(version)
puts "Updating version to #{version}..."
File.write(File.expand_path("./VERSION", __dir__), version.to_s)
`npm version #{version} --git-tag-version=false`
`bundle`
end
desc "Increment to next patch version"
task "version:patch" => :environment do
write_version(current_version.patch!)
end
desc "Increment to next minor version"
task "version:minor" => :environment do
write_version(current_version.minor!)
end
desc "Increment to next major version"
task "version:major" => :environment do
write_version(current_version.major!)
end
desc "Push NPM package"
task "release:npm" => :environment do
system("npm publish --access public")
end
Rake::Task["release"].enhance do
Rake::Task["release:npm"].invoke
end
task default: :spec
task test: :spec