Calculate a semantic version using GitVersion. The version calculated will be based on the tags and git history.
You can use your own configuration file as in the example below, or you can just use a plain version of the action to quickly generate a simple version.
Using the default and below configuration you can bump the major version by creating a commit message like this.
git commit -am "+semver: major | Update to node 21"
| Name | Example |
|---|---|
| Major | 0, 1, 2, 3 |
| FullSemVer | 1.0.0, 0.3.0-alpha.2, 0.3.0-feat-add-kitties.0 |
Basic usage of the composite action without any parameters.
jobs:
versioning:
name: Determine
uses: suspectsoftware/action-semantic-versioning/.github/workflows/main.yml@v1This example shows how to implement the action with a custom configuration and use the output.
jobs:
versioning:
name: Determine
uses: suspectsoftware/action-semantic-versioning/.github/workflows/main.yml@v1
with:
configFilePath: .github/gitversion.yml
Build:
runs-on: ubuntu-latest
needs:
- Versioning
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Print
run: |
echo ${{ needs.Versioning.outputs.Major }}