Skip to content

Commit

Permalink
Improve generation of changelog (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
bensheldon committed Jul 15, 2020
1 parent bf9e8b9 commit 9b0906f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
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

0 comments on commit 9b0906f

Please sign in to comment.