Skip to content

Commit 3254b10

Browse files
authored
Fix rake release task (#101)
1 parent cec7710 commit 3254b10

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

lib/task_helpers/release_util.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ class VersionUpdater
99
extend Rake::DSL
1010

1111
class << self
12+
def version
13+
Semantic::Version.new(File.read("#{root}/ALLURE_VERSION").strip)
14+
end
15+
1216
def update(increment, push)
13-
@version = Semantic::Version.new(File.read("#{root}/ALLURE_VERSION").strip)
17+
@version = version
1418
@new_version = @version.increment!(increment || "patch")
1519

1620
update_allure_version

lib/tasks/release.rake

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,24 @@ class ReleaseTasks
2929
def add_adaptor_build_tasks # rubocop:disable Metrics/MethodLength
3030
adaptors.each do |adaptor|
3131
namespace adaptor do
32-
gem = -> { "#{adaptor}-#{version}.gem" }
33-
gem_path = -> { "#{root}/pkg/#{gem.call}" }
32+
gem = "#{adaptor}-#{VersionUpdater.version}.gem"
33+
gem_path = "#{root}/pkg/#{gem}"
3434
gemspec = "#{adaptor}.gemspec"
3535

3636
task(:clean) do
37-
system("rm -f #{gem_path.call}")
37+
system("rm -f #{gem_path}")
3838
end
3939

4040
task(gem: :pkg) do
41-
puts "Building #{gem.call}".yellow
42-
sh "cd #{adaptor} && gem build #{gemspec} && mv #{gem.call} #{gem_path.call}"
41+
puts "Building #{gem}".yellow
42+
sh "cd #{adaptor} && gem build #{gemspec} && mv #{gem} #{gem_path}"
4343
end
4444

4545
task(build: %i[clean gem])
4646

4747
task(release: :build) do
48-
puts "Pushing #{gem.call}".yellow
49-
sh "gem push #{gem_path.call}"
48+
puts "Pushing #{gem}".yellow
49+
sh "gem push #{gem_path}"
5050
end
5151
end
5252
end

0 commit comments

Comments
 (0)