Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
tag

GitHub Action

Increment Semantic Version

1.0.1

Increment Semantic Version

tag

Increment Semantic Version

Bump a given semantic version by a release type ( major | minor | patch ) and add a possible postfix ( alpha | beta | rc )

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Increment Semantic Version

uses: christian-draeger/[email protected]

Learn more about this action in christian-draeger/increment-semantic-version

Choose a version

Increment Semantic Version

This is a GitHub action to bump a given semantic version, depending on a given version fragment.

Inputs

current-version

Required The current semantic version you want to increment. (e.g. 3.12.5)

version-fragment

Required The versions fragment you want to increment.

Possible options are [ major | feature | bug | alpha | beta | rc ]

Outputs

next-version

The incremented version.

Example usage

- name: Bump release version
  id: bump_version
  uses: christian-draeger/[email protected]
  with:
    current-version: '2.11.7-alpha3'
    version-fragment: 'feature'
- name: Do something with your bumped release version
  run: echo ${{ steps.bump_version.outputs.next-version }}
  # will print 2.12.0

input / output Examples

version-fragment current-version output
major 2.11.7-alpha3 3.0.0
feature 2.11.7-alpha3 2.12.0
bug 2.11.7-alpha3 2.11.8
alpha 2.11.7-alpha3 2.11.7-alpha4
beta 2.11.7-alpha3 2.11.7-beta1
rc 2.11.7-alpha3 2.11.7-rc1

License

The scripts and documentation in this project are released under the MIT License