4 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
Asanga K
8d649fcfa3 Merge pull request #14 from reecetech/fix-git-fetch-tags-issue
[DE-4875] Forcing git fetch tags
2022-02-25 13:36:45 +11:00
karunasa
ccbbbe93a8 [DE-4875] Forcing git fetch tags
Workaround for the issue where in certain cases it's failing when a version tag has moved.
2022-02-25 09:26:09 +11:00
4 changed files with 9 additions and 3 deletions

View File

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

View File

@@ -41,6 +41,9 @@ outputs:
patch-version: patch-version:
description: 'Patch number of the incremented version' description: 'Patch number of the incremented version'
value: ${{ steps.version-increment.outputs.patch-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: major-v-version:
description: 'Major number of the incremented version, prefixed with a `v` charatcter' description: 'Major number of the incremented version, prefixed with a `v` charatcter'
value: ${{ steps.version-increment.outputs.major-v-version }} 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 # add pre-release info to version if not the default branch
if [[ "${current_ref}" != "refs/heads/${default_branch}" ]] ; then 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 fi
if [[ -z "$(echo "${new_version}" | ${grep} -P "${pcre_semver}")" ]] ; then if [[ -z "$(echo "${new_version}" | ${grep} -P "${pcre_semver}")" ]] ; then

View File

@@ -27,7 +27,7 @@ fi
# Skip if testing, otherwise pull tags # Skip if testing, otherwise pull tags
if [[ -z "${BATS_VERSION:-}" ]] ; then if [[ -z "${BATS_VERSION:-}" ]] ; then
git fetch --quiet origin 'refs/tags/*:refs/tags/*' git fetch --quiet --force origin 'refs/tags/*:refs/tags/*'
fi fi
##==---------------------------------------------------------------------------- ##==----------------------------------------------------------------------------