# Release management

By

# Introduction

Rocket 🚀 utilizes semantic-release as package and version management tool. The tool makes a fully automated release possible and is equipped with these features:

  1. automate release
  2. generate release notes
  3. publish package
  4. follow semantic versioning specification: SemVer
  5. determining next version number (and save it to package.json)

# How does it work?

semantic-release uses the commit messages to determine the next release version. To enforce consistent and meaningful commit messages Rocket utilizes -> commitlint.

# Configuration

Rocket semantic-release configuration is in .releaserc and defines:

Options Type Description Rocket
branches Array, String the branches on which releases should happen main
plugins Array List of plugins, will run in series, in the order defined, in each step see plugins

# Rules

The plugin commit-analyzer checks all commits. The table shows which commit message leads to which release type when semantic-release runs.

Commit message Release type Current Version New version
fix(product): Fix(patch) Release 1.0.0 1.0.1
feat(product): Feature(minor) Release 1.0.0 1.1.0
BREAKING_CHANGE (in footer) Breaking(major) Release 1.0.0 2.0.0
  • These rules can be changed in .releaserc. Rocket uses the preset conventionalcommits and defines no additional rules so far.
  • If a release consists of multiple commits that match the rules, the one with the highest release type will determine the global release type.

# Automation with CI

There is nothing to do: semantic-release is executed after every push on the release branch (main) - e.g. when the dev branch is merged into the main on the end of a sprint.

# GitHub Action

The release is triggered by a GitHub Action Workflow.

# Plugins

Plugins are configured in .releaserc. Don't change the order.

Further information: semantic-release docs

# Changelog

By now all commits get written to the changelog file. To reduce this

# Steps

graph TD;
  	A[Push to main branch] --> |triggers| B{GitHub Action}
    B --> |semantic-release steps| C(Verify conditions of plugins and GitHub authentication)
    C --> D(Get latest release by analyzing git tags)
    D --> E(Analyze commits since last release)
    E --> F(Determine release type)
    F --> |patch/minor/major release| G(Verify release)
    F --> |no release| Z(Cancel)
    G --> H(Generate Notes > CHANGELOG.md, update package.json)
    H --> I(Create Git Tag)
    I --> J(Prepare git release)
    J --> K(Publish release on GitHub Packages)