-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathRakefile
More file actions
67 lines (58 loc) · 1.89 KB
/
Rakefile
File metadata and controls
67 lines (58 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# frozen_string_literal: true
require 'open3'
require 'rake'
RED = "\033[31m"
GREEN = "\033[32m"
RESET = "\033[0m"
def run_command(cmd, silent: true, print_command: false, report_status: false)
puts "#{GREEN}Running #{cmd}#{RESET}" if print_command
output = ''
Open3.popen2e(cmd) do |_stdin, stdout_stderr, thread|
stdout_stderr.each do |line|
puts line unless silent
output += line
end
exitcode = thread.value.exitstatus
unless exitcode.zero?
err = "#{RED}Command failed! Command: #{cmd}, Exit code: #{exitcode}"
# Print details if we were running silent
err += "\nOutput:\n#{output}" if silent
err += RESET
abort err
end
puts "#{GREEN}Command finished with status #{exitcode}#{RESET}" if report_status
end
output.chomp
end
begin
require 'github_changelog_generator/task'
require_relative 'lib/bolt/version'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.header = <<~HEADER.chomp
# Changelog
All notable changes to this project will be documented in this file.
HEADER
config.user = 'openvoxproject'
config.project = 'openbolt'
config.exclude_labels = %w[dependencies duplicate question invalid wontfix wont-fix modulesync skip-changelog]
config.future_release = Bolt::VERSION
# we limit the changelog to all new openvox releases, to skip perforce onces
# otherwise the changelog generate takes a lot amount of time
config.since_tag = '4.0.0'
end
rescue LoadError
task :changelog do
abort('Run `bundle install --with release` to install the `github_changelog_generator` gem.')
end
end
desc 'Prepare for a release'
task 'release:prepare' => [:changelog]
desc "Check for new versions of bundled modules"
task :update_modules do
sh "scripts/update_modules.rb"
end
begin
require 'voxpupuli/rubocop/rake'
rescue LoadError
# the voxpupuli-rubocop gem is optional
end