Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Configure the load path so all dependencies in your Gemfile can be required
require 'bundler/setup'

require 'rainbow'

def info(message)
Expand Down Expand Up @@ -36,7 +39,7 @@ def git_url
end

# Get the CI Status (needs https://hub.github.com/)
def ci_status(branch = 'master')
def git_ci_status(branch = 'master')
`hub ci-status #{branch}`.strip
end

Expand All @@ -52,7 +55,7 @@ def git_clean_repo
abort('ERROR: There are untracked files.')
end

return true
true
end

# Get version number from git tags
Expand Down Expand Up @@ -86,9 +89,16 @@ def configure_changelog(config, release: nil)
end

# GitHub CHANGELOG generator
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new(:unreleased) do |config|
configure_changelog(config)
# Might not be always present, for example with
# `bundle install --without development`
begin
# GitHub CHANGELOG generator
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new(:unreleased) do |config|
configure_changelog(config)
end
rescue LoadError
warn 'github_changelog_generator gem is not installed'
end

# Release task
Expand Down Expand Up @@ -120,7 +130,7 @@ namespace :release do

# Waiting for CI to finish
puts 'Waiting for CI to finish'
sleep 5 until ci_status(release_branch) == 'success'
sleep 5 until git_ci_status(release_branch) == 'success'

# Merge release branch
sh "git checkout #{initial_branch}"
Expand All @@ -133,13 +143,19 @@ namespace :release do
end
end

# List all tasks by default
task :default do
puts `rake -T`
end

# Version
desc 'Display version'
task :version do
puts "Current version: #{version}"
end

# Create a list of contributors from GitHub
desc 'Populate CONTRIBUTORS file'
task :contributors do
system("git log --format='%aN' | sort -u > CONTRIBUTORS")
end

# List all tasks by default
task :default do
puts `rake -T`
end