Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve generation of changelog #36

Merged
merged 1 commit into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Package maintainers can release this gem with the following [gem-release](https:
$ gem signin

# Update version number, changelog, and create git commit:
$ bundle exec rake commit_version
$ bundle exec rake commit_version[minor] # major,minor,patch

# ..and follow subsequent directions.
```
Expand Down
23 changes: 7 additions & 16 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,17 @@ end

require 'bundler/gem_tasks'

require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.user = 'bensheldon'
config.project = 'good_job'
config.future_release = GoodJob::VERSION
end

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

desc 'Commit version and changelog'
task :commit_version, [:version_bump] do |_t, args|
version_bump = args[:version_bump]
if version_bump.blank?
if version_bump.nil?
puts "Pass a version [major|minor|patch|pre|release] or a given version number [x.x.x]:"
puts "$ bundle exec commit_version[VERSION_BUMP]"
return
puts "$ bundle exec rake commit_version[VERSION_BUMP]"
exit(1)
end

puts "\n== Bumping version number =="
Expand All @@ -46,7 +39,7 @@ task :commit_version, [:version_bump] do |_t, args|
puts GoodJob::VERSION

puts "\n== Updating Changelog =="
system! "bundle exec foreman run rake changelog"
system! ENV, "bundle exec github_changelog_generator --user bensheldon --project good_job --future-release v#{GoodJob::VERSION}"

puts "\n== Updating Gemfile.lock version =="
system! "bundle install"
Expand All @@ -58,11 +51,9 @@ task :commit_version, [:version_bump] do |_t, args|
system! "git tag v#{GoodJob::VERSION}"

puts "\n== Next steps =="
puts "Push commit and tag to Github:"
puts "$ git push origin v#{GoodJob::VERSION}"
puts "\n"
puts "Push to rubygems"
puts "$ gem release"
puts "Run the following commands:\n\n"
puts "1. Push commit and tag to Github: `$ git push origin v#{GoodJob::VERSION}`"
puts "2. Push to Rubygems.org: `$ gem release`"
end

require 'rspec/core/rake_task'
Expand Down