The project is in a healthy, maintained state
This gem helps you to manage the version number of your application or library. It provides Rake tasks to automatically update your version file, changelog file, and create a git tag.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

SemanticRelease

Build Status Release License

This gem helps you to manage the version number of your application or library.

Use the provided Rake tasks to:

  • bump the major, minor, or patch number of your version
  • automatically update your version file (e.g. lib/version.rb)
  • automatically update your changelog (CHANGELOG.md or history.rdoc)
  • automatically create a git commit and tag for the release

This gem was inspired by:

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add semantic_release

If bundler is not being used to manage dependencies, install the gem by executing:

gem install semantic_release

Usage

Add the Rake task by adding the following lines to a Rake configuration file (e.g. Rakefile or lib/tasks/default.rake):

require "semantic_release/rake_task"
SemanticRelease::RakeTask.new

The name of the rake task and other options are configurable like so:

require "semantic_release/rake_task"
SemanticRelease::RakeTask.new(:semver) do |config|
  config.semver_file = "semver.json"
end

The following tasks are available:

rake release:init
rake release:current
rake release:major
rake release:minor
rake release:patch

To get the current version inside your application:

SemanticRelease.current_version

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

To release a new version, run bundle exec rake semver:XXX (replacing XXX with major or minor or patch), which will bump the version number and create a git tag for the version. Then run git push origin main --tags to push the new tag.

Then run bundle exec rake release, which will build and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ukdave/semantic_release.

License

The gem is available as open source under the terms of the MIT License.