Semantic Version Increment
ActionsThis GitHub action automates semantic versioning and release creation for your projects. It supports different release types, pre-release labels and build numbers.
- SemVer 2.0 compatible (MAJOR.MINOR.PATCH-PRERELEASE+BUILD)
- Release types: major, minor, patch, alpha, beta, rc, stable
- Combined releases (e.g. major-alpha, patch-rc)
- Automatic build numbers (optional)
- Strict pre-versioning (e.g. consecutive numbers for pre-releases)
- Build-only updates (without version change)
Required Current semantic version to increment
- Format:
[v]X.Y.Z[-PRERELEASE][+BUILD] - Examples:
1.0.0,v2.5.0-rc.4,3.0.0-alpha+567
Required Type of version increment:
| Category | Values |
|---|---|
| Version Bumps | major, minor, patch |
| Pre-Releases | alpha, beta, pre, rc, stable |
| Combined Types | patch-alpha, minor-beta, major-rc etc. |
| Special | none (only build number) |
Notes:
- Combined Types: All version bumps can be combined with pre-release types.
- Additional Types:
hotfix,bug, andfeatureare also supported. While they are not part of the SemVer standard, they can be useful for specific user scenarios.
Optional [true|false] Default: true
Controls pre-release numbering behavior:
| Value | Behavior |
|---|---|
true |
Always use .N numbering (even first pre-release) |
false |
First pre-release without number, subsequent get .1, .2, etc. |
Optional [true|false] Default: false
Sets starting index for pre-release versions:
true: Start counting at.0(e.g.,-alpha.0)false: Start counting at.1(e.g.,-beta.1)
Optional [true|false] Default: false
Enables build counter stored in .build-version file:
true: Appends+Nwhere N auto-incrementsfalse: No build number added
Optional [true|false] Default: false
Determines whether a v prefix is prepended to the version number:
true: The version number is prefixed with av(e.g.v1.0.0)false: The version number is shown without avprefix (e.g.1.0.0)
Notes:
Adding a v prefix does not conform to the Semantic Versioning 2.0.0 specification as outlined on semver.org. Although commonly used, the v prefix is not part of the official SemVer definition. Nevertheless, it has been included here due to its widespread usage.
The generated version in SemVer format, depending on the provided parameters:
X.Y.Z[-PRERELEASE][+BUILD]
- uses: psycho0verload/increment-version@latest
with:
current-version: '1.2.3'
version-type: 'major'The Basic example is the simplest form of usage. The expected result is: 2.0.0.
- uses: psycho0verload/increment-version@latest
with:
current-version: 'v1.0.0-rc.5+123'
version-type: 'major'
preversion: false
preversion-start-zero: true
use-build: true
prefix: falseThe expected result is: 1.0.1-alpha+124.
To provide an insight into the behavior and a view of the expected results, here are a few cases with their results:
- Increase
1.0.0throughpatchand all possible combinations of options - Increase
v1.0.0throughpatchand all possible combinations of options - Increase
v1.0.0+123throughpatch-alphaand all possible combinations of options - Increase
v1.0.0-rc.5+123throughpatch-alphaand all possible combinations of options - Increase
v1.0.0-rc.5+123throughrcand all possible combinations of options
Semantic Version Increment is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.