Auto Increment Version
This action will automatically determine the version for next release by using repository tags. For develop releases:
Action Inputs
- github_token: Token to get tags from the repo. Pass in using 'secrets.GITHUB_TOKEN'.
- mode: Mode for next version calculation. Default: 'dev'. Available options:
- dev: increment the 'dev' version (ignoring commit message) e.g. 1.0-dev1, 1.0-dev2.
- stable search the commit message for hashtags: #major - for major version (e.g 2.0), #patch - for patch version (e.g 1.1), if no hashtag found fails.
- suffix: suffix for un stable releases. default: 'dev'.
Action Outputs
- version: The next release version
Example
- Pushing commits to develop branch -> 1.0-dev0 -> 1.0-dev1 -> 1.0-dev2 ...
- Releasing an stable release -> commit with '#major' in commit message & push to main branch -> 1.0
- Continue development (working on the next release), pushing to develop branch -> 2.0-dev0 -> 2.0-dev1 -> 2.0-dev2 ...
- Hot-fix needed (stable release) -> commit with '#patch' in commit message & push to main branch -> 1.1
- Continue pushing to develop branch -> 2.0-dev0 -> 2.0-dev1 -> 2.0-dev2 ...
Usage
- name: Auto Increment Version
uses: docker://igorgov/auto-inc-ver:v1.2.0
id: versioning
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
mode: stable
- name: Print next release version
shell: bash
run: |
echo "${{ steps.versioning.outputs.version }}"