2 Commits

Author SHA1 Message Date
Philip Jay
53a0819e66 Merge pull request #15 from reecetech/pre-release
Expose the pre-release label as an output
2022-05-16 11:08:08 +10:00
Phil Jay
e53268eb3f Expose the pre-release label as an output 2022-05-12 15:44:33 +10:00
3 changed files with 8 additions and 2 deletions

View File

@@ -9,7 +9,7 @@
uses: actions/checkout@v2
- name: Get next version
uses: reecetech/version-increment@2022.2.4
uses: reecetech/version-increment@2022.5.1
id: version
with:
scheme: semver
@@ -91,6 +91,7 @@ Examples:
| major-version | Major number of the incremented version |
| minor-version | Minor number of the incremented version |
| patch-version | Patch number of the incremented version |
| pre-release-label | Pre-release label of the incremented version |
| major-v-version | Major number of the incremented version, prefixed with a `v` character |
| minor-v-version | Minor number of the incremented version, prefixed with a `v` character |
| patch-v-version | Patch number of the incremented version, prefixed with a `v` character |

View File

@@ -41,6 +41,9 @@ outputs:
patch-version:
description: 'Patch number of the incremented version'
value: ${{ steps.version-increment.outputs.patch-version }}
pre-release-version:
description: 'Pre-release label of the incremented version'
value: ${{ steps.version-increment.outputs.pre-release-label }}
major-v-version:
description: 'Major number of the incremented version, prefixed with a `v` charatcter'
value: ${{ steps.version-increment.outputs.major-v-version }}

View File

@@ -74,7 +74,9 @@ fi
# add pre-release info to version if not the default branch
if [[ "${current_ref}" != "refs/heads/${default_branch}" ]] ; then
new_version="${new_version}-pre.${git_commit}"
pre_release="pre.${git_commit}"
new_version="${new_version}-${pre_release}"
echo "::set-output name=pre-release-label::${pre_release}"
fi
if [[ -z "$(echo "${new_version}" | ${grep} -P "${pcre_semver}")" ]] ; then