TL;DR

Semantic versioning is a set of rules and guidelines for assigning version numbers to software releases, providing a standardized way to indicate the magnitude of changes between versions and helping users and developers understand the impact of updates.


Concept

Semantic versioning is a widely adopted convention for versioning software releases. It establishes a consistent format for version numbers and defines specific rules for incrementing those numbers based on the type of changes made to the software. By following semantic versioning, teams can effectively communicate the scope and impact of updates to users and other stakeholders.

Semantic Versioning Format:

The semantic version format consists of three numbers separated by periods: MAJOR.MINOR.PATCH

  1. MAJOR version: Incremented when incompatible API changes are made.
  2. MINOR version: Incremented when new functionality is added in a backwards-compatible manner.
  3. PATCH version: Incremented when backwards-compatible bug fixes are introduced.

For example, a version number like 2.4.7 would be interpreted as:

  • MAJOR version 2
  • MINOR version 4
  • PATCH version 7

Semantic Versioning Rules:

  1. MAJOR version: Increment the MAJOR version when you make incompatible API changes.
  2. MINOR version: Increment the MINOR version when you add functionality in a backwards-compatible manner.
  3. PATCH version: Increment the PATCH version when you make backwards-compatible bug fixes.
  4. Pre-release versions: Append a hyphen and a series of dot-separated identifiers immediately following the patch version to indicate a pre-release version (e.g., 1.0.0-alpha, 1.0.0-beta.2).
  5. Build metadata: Append a plus sign and a series of dot-separated identifiers immediately following the patch or pre-release version to indicate build metadata (e.g., 1.0.0-beta.2+exp.sha.5114f85).

By adopting semantic versioning, teams can improve communication, enhance dependency management, and streamline release processes, ultimately leading to more reliable and predictable software updates.