Skip to content

Commit

Permalink
Fix rake release task
Browse files Browse the repository at this point in the history
  • Loading branch information
andrcuns committed Mar 28, 2020
1 parent cec7710 commit e0bb3f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion lib/task_helpers/release_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ class VersionUpdater
extend Rake::DSL

class << self
def version
Semantic::Version.new(File.read("#{root}/ALLURE_VERSION").strip)
end

def update(increment, push)
@version = Semantic::Version.new(File.read("#{root}/ALLURE_VERSION").strip)
@version = version
@new_version = @version.increment!(increment || "patch")

update_allure_version
Expand Down
14 changes: 7 additions & 7 deletions lib/tasks/release.rake
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ class ReleaseTasks
def add_adaptor_build_tasks # rubocop:disable Metrics/MethodLength
adaptors.each do |adaptor|
namespace adaptor do
gem = -> { "#{adaptor}-#{version}.gem" }
gem_path = -> { "#{root}/pkg/#{gem.call}" }
gem = "#{adaptor}-#{VersionUpdater.version}.gem"
gem_path = "#{root}/pkg/#{gem}"
gemspec = "#{adaptor}.gemspec"

task(:clean) do
system("rm -f #{gem_path.call}")
system("rm -f #{gem_path}")
end

task(gem: :pkg) do
puts "Building #{gem.call}".yellow
sh "cd #{adaptor} && gem build #{gemspec} && mv #{gem.call} #{gem_path.call}"
puts "Building #{gem}".yellow
sh "cd #{adaptor} && gem build #{gemspec} && mv #{gem} #{gem_path}"
end

task(build: %i[clean gem])

task(release: :build) do
puts "Pushing #{gem.call}".yellow
sh "gem push #{gem_path.call}"
puts "Pushing #{gem}".yellow
sh "gem push #{gem_path}"
end
end
end
Expand Down

0 comments on commit e0bb3f1

Please sign in to comment.