How to release a version - projectblacklight/blacklight GitHub Wiki

Before releasing, ensure that you're on the main branch.

Release it

  1. Update the version number in ./VERSION and ./package.json

    {major}.{minor}.{patch}
    

    For pre-releases, rubygems versions look like eg 3.0.0.beta1, but npm package versions (which don't allow a fourth period) look like 3.0.0-beta1.

    Then run npm install so package-lock.json picks up the new version, and commit all three files. (rake release refuses to run if the working tree isn't clean, and npm install would otherwise change the lockfile partway through the release.)

  2. Release the gem and npm package

    $ npm login
    $ bundle exec rake release
    

    For Blacklight 8 and later, rake release does everything: it builds the JavaScript (build:npm), builds the gem, tags and pushes the release, pushes the gem to rubygems.org, and runs npm publish. To skip the npm step, use npm_push=no bundle exec rake release.

    • If your rubygems.org account has MFA enabled, the gem push will fail when it can't prompt for a code (for example when run by a script or agent). The tag is already pushed at that point, so finish with gem push pkg/blacklight-{version}.gem --otp {code} and then npm publish.

    • For Blacklight 7, rake release doesn't publish to npm. Afterwards run npm run js-compile-bundle and then npm publish.

    • Note that running npm publish tags the release as latest, which we only want to happen for releases within the current major version. So if you're publishing a new release of an older Blacklight version, you can fix this via e.g. $ npm dist-tag add [email protected] latest

    • If you are a Blacklight committer who does not have privileges to release the ruby gem or npm package, ask someone else who does to add you!

  3. Write Github release notes for the tag, using this template:

    [Commit History](https://github.com/projectblacklight/blacklight/compare/v5.x.0...v5.x.0) | [Milestone](https://github.com/projectblacklight/blacklight/issues?q=milestone:{milestone here})
    
    (anything important about this release, themes, etc)
    
    ### New Features and improvements
    
    (#ticketnumber and a human-readable description of the ticket, usually the ticket title. If the ticket title doesn't make sense, either edit the ticket directly, or provide an alternative title here)
    
    ##  Bug Fixes
    
    ### Upgrade Notes
    
    (anything special that needs to be called out)
    
    ### Tested dependencies
    
    This version of Blacklight works on Ruby on Rails 6.1 - 7.0. (This can be found in https://github.com/projectblacklight/blacklight/blob/main/.github/matrix.json)
    
  4. Prepare announcement