Class: SemanticRelease::Updaters::GitTag

Inherits:
BaseUpdater show all
Defined in:
lib/semantic_release/updaters/git_tag.rb

Class Method Summary collapse

Methods inherited from BaseUpdater

current_version, current_version_tag, gemspec_present?, semver_file

Class Method Details

.updateObject

rubocop:disable Style/GuardClause



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/semantic_release/updaters/git_tag.rb', line 7

def self.update
  tag = current_version_tag
  msg = "Increment version to #{tag}"

  `git add #{semver_file} && git commit -m '#{msg}' && git tag #{tag} -a -m '#{Time.now}'`

  branch = `git rev-parse --abbrev-ref HEAD`.chomp
  puts "To push the new tag, use 'git push origin #{branch} --tags'"

  if gemspec_present? && !SemanticRelease.configuration.disable_rubygems_message
    puts "To build and push the .gem file to rubygems.org use, 'bundle exec rake release'"
  end
end