-
Notifications
You must be signed in to change notification settings - Fork 78
Release Steps
Hello future maintainer! If you're reading this, I'm going to assume you already have Ruby installed, the repo cloned and a (at least minimal) understanding of the code base.
-
bundle exec rake spec
. -
gem build adal.gemspec
. -
gem push adal-x.y.z.gem
. This requires RubyGems credentials. -
Create a new release in GitHub, tag it as
vX.Y.Z
and uploadadal-x.y.z.gem
as an attachment.
Ruby gems (including this one) are generally hosted at https://rubygems.org. This is where gem
, bundle
and all other Ruby tools that deal with dependency management look for gems. There are a few steps you will have to undertake to get the latest, greatest code available to the public on RubyGems.
First, make sure you are on the master branch. We should only ever submit gems that are built off of the master branch.
Before you proceed, you should ensure that all the tests pass. bundle exec rake spec
will fetch all the dependencies (if you don't already have them) and run the test suite. This will also inform you of the test coverage percentage. This should be at a reasonable level.
Next, make sure that the version number is correct. You may notice that adal.gemspec
includes the line s.version = ADAL::Version
. This is calling the to_s
method on the class ADAL::Version
which is defined in lib/adal/version.rb
. You will want to update the MAJOR
, MINOR
and UPDATE
constants there.
Now you can build the Gem with gem build adal.gemspec
. Note that this is not the same as compiling. You will not be alerted of syntax errors or anything in the code. This is why we have tests.
You should now have a file called adal-x.y.z.gem
with the appropriate values of x, y and z. This is what is uploaded to RubyGems. You upload it with the command gem push adal-x.y.z.gem
. This will require credentials. In order for the push to succeed, you must be listed as an owner of the gem on RubyGems. At the time of writing, it is undecided who will have this priviledge.
If you've reached this point, the code is live. There is no going back now. If you messed up, you can "yank" the gem from RubyGems, but you cannot reuse the version number. (Yanking also looks super super bad, please don't do it.)
By convention, you should mark the current state of the codebase as a release on GitHub. To do this, go to the Releases tab of the repo and select "Create a new release". Tag it with the version number and upload adal-x.y.z.gem
as an attachment.
Congrats, you're done!
- Adam