Skip to content

ukdave/semantic_release

Repository files navigation

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"
  config.disable_rubygems_message = true
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.

About

Ruby gem to help you to manage your version number and releases

Resources

License

Stars

Watchers

Forks

Packages

No packages published