8 Commits

Author SHA1 Message Date
Asanga
40611bca96 Merge pull request #12 from reecetech/using-v-outputs
Using v-* outputs in favor of string manipulation
2022-02-08 15:14:10 +11:00
Asanga
ddfcb5bc04 Updating to the latest version 2022-02-08 15:07:45 +11:00
Asanga
3d00642def Using v-* outputs in favor of string manipulation 2022-02-08 15:06:28 +11:00
Philip Jay
827489c005 Merge pull request #11 from reecetech/fixing-outputs
Fixing the outputs to match README
2022-02-08 14:55:07 +11:00
Phil Jay
ee28762c5b Update README for next version 2022-02-08 14:52:41 +11:00
Asanga
1c6699b17a Fixing the outputs to match with README 2022-02-08 14:40:16 +11:00
Philip Jay
822afeb70c Merge pull request #10 from reecetech/DE-4401-fix-for-pipefails
Avoid broken pipe exits (`141`) when `head` exits
2022-02-01 16:52:07 +11:00
Phil Jay
9492ff84fb Avoid broken pipe exits (141) when head exits
Intermittent issue, only observed on self-hosted agents on VMware (due
to multi-core processing)
2022-02-01 12:23:49 +11:00
3 changed files with 10 additions and 4 deletions

View File

@@ -9,7 +9,7 @@
uses: actions/checkout@v2
- name: Get next version
uses: reecetech/version-increment@2021.11.2
uses: reecetech/version-increment@2022.2.3
id: version
with:
scheme: semver

View File

@@ -20,12 +20,18 @@ inputs:
default: 'patch'
outputs:
current_version:
current-version:
description: 'Current normal version detected'
value: ${{ steps.version-lookup.outputs.current-version }}
current-v-version:
description: 'Current normal version detected, prefixed with a `v` charatcter'
value: ${{ steps.version-lookup.outputs.current-v-version }}
version:
description: 'Incremented version calculated'
value: ${{ steps.version-increment.outputs.version }}
v-version:
description: 'Incremented version calculated, prefixed with a `v` charatcter'
value: ${{ steps.version-increment.outputs.v-version }}
runs:
using: "composite"

View File

@@ -34,11 +34,11 @@ fi
## Version parsing
# detect current version - removing "v" from start of tag if it exists
current_version="$(git tag -l | { ${grep} -P "${pcre_allow_vprefix}" || true; } | sed 's/^v//g' | sort -V --reverse | head -n1)"
current_version="$(git tag -l | { ${grep} -P "${pcre_allow_vprefix}" || true; } | sed 's/^v//g' | sort -V | tail -n 1)"
# support transition from an old reecetech calver style (yyyy-mm-Rr, where R is the literal `R`, and r is the nth release for the month)
if [[ -z "${current_version:-}" ]] ; then
current_version="$(git tag -l | { ${grep} -P "${pcre_old_calver}" || true; } | sort -V --reverse | head -n1)"
current_version="$(git tag -l | { ${grep} -P "${pcre_old_calver}" || true; } | sort -V | tail -n 1)"
if [[ -n "${current_version:-}" ]] ; then
# convert - to . and drop leading zeros & the R
current_version="$(echo "${current_version}" | sed -r 's/^([0-9]+)-0{0,1}([0-9]+)-R0{0,1}([0-9]+)$/\1.\2.\3/')"