Class: CovLoupe::Scripts::PreReleaseCheck

Inherits:
Object
  • Object
show all
Includes:
CommandExecution
Defined in:
lib/cov_loupe/scripts/pre_release_check.rb

Constant Summary collapse

ROOT =
Pathname.new(__dir__).join('../../..').expand_path

Instance Method Summary collapse

Methods included from CommandExecution

#abort_with, #command_exists?, #run_command, #run_command_with_status

Instance Method Details

#callObject



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
48
49
50
51
# File 'lib/cov_loupe/scripts/pre_release_check.rb', line 16

def call
  Dir.chdir(ROOT) do
    verify_git_clean!
    puts '✓ Git working tree is clean'

    verify_branch!
    puts '✓ On main branch'

    verify_sync!
    puts '✓ Local branch is in sync with origin/main'

    verify_ci_passed!
    puts '✓ GitHub Actions CI passed'

    @version = fetch_version
    @tag_name = "v#{@version}"
    puts "✓ Preparing release for version #{@version}"

    verify_release_notes!
    puts "✓ Release notes found for #{@tag_name}"

    verify_tag_new!
    puts "✓ Tag #{@tag_name} does not yet exist"

    build_gem!
    puts '✓ Gem built successfully'

    puts "\nBuild complete! To finish the release, run:"
    puts
    puts "  git tag -a #{@tag_name} -m 'Version #{@version}'"
    puts '  git push origin main --follow-tags'
    puts "  gem push #{@gem_file.basename}"
    puts
    puts 'Then draft the GitHub release via the web UI.'
  end
end