Skip to content
play

GitHub Action

Bump Release Version

0.1.8 Latest version

Bump Release Version

play

Bump Release Version

Bump version number to aid automated release processes

Installation

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

              

- name: Bump Release Version

uses: fwilhe2/[email protected]

Learn more about this action in fwilhe2/bump-version

Choose a version

Bump Version

Gets the latest release version and increases it, useful for automatic releases.

Examples

Example workflow to release a new version with auto-incrementing version number

    - uses: fwilhe2/bump-version@main
      id: bump
    - run: echo ${{ steps.bump.outputs.newVersion }}

    - uses: actions/create-release@v1
      with:
        tag_name: ${{ steps.bump.outputs.newVersion }}

Update a specific version component

You can select the version component to update. By default, the minor version is updated. Valid values are major, minor, patch.

Example to update the patch version:

    - uses: fwilhe2/bump-version@main
      id: bump
      with:
        component: patch
    - run: echo ${{ steps.bump.outputs.newVersion }}

Configure version component via workflow_dispatch

If you want to select a version number component to update when triggering a release via workflow_dispatch, you might want to use inputs as in this example.

on:
  push:
  workflow_dispatch:
    inputs:
      component:
        description: 'Version component to increment'
        required: true
        default: 'patch'
jobs:
  build:
    name: Create Release
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v2
    - name: Get Version Number
      uses: fwilhe2/bump-version@main
      id: bump
      with:
        component: ${{ github.event.inputs.component }}

License

This software is released under the MIT License (MIT), see LICENSE for details.