timbertson / autorelease-tagger-action

Generate & tag versions based on git history
3 stars 4 forks source link

Autorelease Tagger

Generates new version tags from git history

The process, in detail:

versionTemplate:

As of 2020-12, a versionTemplate option is allowed, which provides a convenient way to specify numComponents, minBump, as well as validating that the chosen version matches the expected pattern.

Examples include:

v1.2.x: allow only patch increments v1.x.x: allow minor or patch increments v1.x.0: allow only minor increments vx.x.x: equivalent to numComponents: 3

The handling of versionTemplate is intentionally complex, to "do the right thing" for common use cases without requiring the use of unweildy workflow expressions:

This lets you pass in the branch name and have it work for both master and appropriately-named version branches, like so:

- uses: timbertson/autorelease-tagger-action@v1
  with:
    numComponents: 3
    minBump: minor
    versionTemplate: ${{ github.base_ref || github.ref }}

That will use the base_ref (destination branch) for a pull request, and the current branch for a push event. For the main branch it acts like a versionTemplate of vx.x.0 thanks to the default numComponents and minBump.

Big thanks

Inpired by the Github Tag Bump action, but with a few improvements: