Skip to content

Latest commit

 

History

History
63 lines (39 loc) · 1.71 KB

.bumpversion.md

File metadata and controls

63 lines (39 loc) · 1.71 KB

Semantic versioning example

bumpversion flow:

1.0.0 => 1.0.1-dev0 => 1.0.1-dev1 = > 1.0.1-rc0 => 1.0.1-rc1 => 1.0.1
         patch         build          release      build        release

Details

Start with an initial release, say 1.0.0.

  1. Starting a new development cycle by bumping patch only once!

     $ bumpversion patch --no-commit
     git tag => v1.0.1-dev0
     CMake PROJECT_VERSION => 1.0.1(.0)?
    
  2. Every time you build, bump build.

     $ bumpversion build --no-tag
     git tag => v1.0.1-dev1
     CMake PROJECT_VERSION => 1.0.1.1
    
  3. Go to release candidate by bumping release only once!

     $ bumpversion release --no-commit
     git tag => v1.0.1-rc0
     CMake PROJECT_VERSION => 1.0.1(.0)?
    
  4. With every new build, bump build.

     $ bumpversion build --tag
     git tag => v1.0.1-rc1
     CMake PROJECT_VERSION => 1.0.1.1
    
  5. Finally, bump release to generate a final release for the current major / minor / patch version.

     $ bumpversion release --tag
     git tag => v1.0.1
     CMake PROJECT_VERSION => 1.0.1
    

Notes

  • Once the final release has been reached, it is not possible to bump the release before bumping patch again. Trying to bump the release while in final release state will issue ValueError: The part has already the maximum value among ['dev', 'rc', 'ga'] and cannot be bumped.

  • A whole version string may be set with:

    bumpversion --new-version 11.1.4-rc2 --tag release

Reference

To install bumpversion:

pip install --upgrade bump2version

https://github.com/c4urself/bump2version#installation https://cmake.org/cmake/help/latest/variable/PROJECT_VERSION.html#variable:PROJECT_VERSION