11name : ' Increment version'
2- description : ' Increment the release version using Conventional Commits'
2+ description : |
3+ Increment the release version based on Conventional Commits.
4+
5+ If there are releasable changes (e.g. fix or feature commits) since the
6+ previous release then this action will tag a new version.
7+
8+ If there are no releasable changes (e.g. only ci or docs commits) since the
9+ previous release, this action does nothing.
10+ inputs :
11+ pre-release-type :
12+ type : string
13+ required : false
14+ description : |
15+ The pre-release version type, for example "alpha".
16+
17+ A numeric identifier will be appended and incremented automatically.
318
419outputs :
520 current_version :
6- description : ' current semantic version'
21+ description : |
22+ The semantic version, prior to the version increment.
23+
24+ If a pre-release version is supplied to the action, and the latest
25+ version was a pre-release, this will be a pre-release.
726 value : ${{ steps.versioning.outputs.current_version }}
827 new_version :
9- description : ' new semantic version'
28+ description : |
29+ If this action bumped the version, this is the new version.
30+
31+ If this action didn't bump the version, this will be the same as the
32+ current version.
33+
34+ If a pre-release version is supplied to the action, this may be a
35+ new pre-release.
1036 value : ${{ steps.versioning.outputs.new_version }}
1137
1238runs :
1339 using : " composite"
1440 steps :
15- - name : Increment the release version using Conventional Commits
16- id : versioning
41+ - name : Configure Git user
1742 run : |
1843 git config user.name github-actions
1944 git config user.email github-actions@github.com
45+ shell : bash
2046
21- current_version=$(cog -v get-version)
22- echo "current_version=$current_version" >> $GITHUB_OUTPUT
47+ - name : Set Github Action path
48+ run : echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
49+ shell : bash
50+ env :
51+ GITHUB_ACTION_PATH : ${{ github.action_path }}
2352
24- cog bump --auto
53+ - name : Calculate the pre-release version
54+ id : pre-release
55+ if : ${{ inputs.pre-release-type != '' }}
56+ run : calculate_prerelease.bash "$PRE_RELEASE_TYPE" >> $GITHUB_OUTPUT
57+ shell : bash
58+ env :
59+ PRE_RELEASE_TYPE : ${{ inputs.pre-release-type }}
2560
26- new_version=$(cog -v get-version)
27- echo "new_version=$new_version" >> $GITHUB_OUTPUT
28- shell : bash
61+ - name : Increment the release version using Conventional Commits
62+ run : increment_version.bash "$PRE_RELEASE" >> $GITHUB_OUTPUT
63+ shell : bash
64+ env :
65+ PRE_RELEASE : ${{ steps.pre-release.outputs.version }}
0 commit comments