module GemToys::Template::Release::Git

Helper module with methods about `git` for `release` tool

Private Instance Methods

commit_changes() click to toggle source
# File lib/gem_toys/template/release/git.rb, line 31
def commit_changes
        puts 'Committing changes...'

        sh "git add #{version_file_path} #{changelog_file_path}"

        sh "git commit -m 'Update version to #{@new_version}'"
end
process_git() click to toggle source
# File lib/gem_toys/template/release/git.rb, line 10
def process_git
        new_version_git_tag = "#{@template.version_tag_prefix}#{@new_version}"

        ## Checkout to a new git branch, required for protected `master` with CI
        # sh "git switch -c #{new_version_git_tag}"

        commit_changes

        ## Tag commit
        puts 'Tagging the commit...'
        sh "git tag -a #{new_version_git_tag} -m 'Version #{@new_version}'"

        ## Push commit
        puts 'Pushing commit...'
        sh 'git push'

        ## Push tags
        puts 'Pushing tags...'
        sh 'git push --tags'
end