mirror of
https://github.com/reecetech/version-increment.git
synced 2025-12-21 14:35:44 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53a0819e66 | ||
|
|
e53268eb3f | ||
|
|
8d649fcfa3 | ||
|
|
ccbbbe93a8 | ||
|
|
ddbbe72b7f | ||
|
|
ba14b463c4 | ||
|
|
fde70f2da9 | ||
|
|
8b854651df | ||
|
|
40611bca96 | ||
|
|
ddfcb5bc04 | ||
|
|
3d00642def |
@@ -9,7 +9,7 @@
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get next version
|
||||
uses: reecetech/version-increment@2022.2.2
|
||||
uses: reecetech/version-increment@2022.5.1
|
||||
id: version
|
||||
with:
|
||||
scheme: semver
|
||||
@@ -88,6 +88,13 @@ Examples:
|
||||
| current-v-version | The current latest version detected from the git repositories tags, prefixed with a `v` character |
|
||||
| version | The incremented version number (e.g. the next version) |
|
||||
| v-version | The incremented version number (e.g. the next version), prefixed with a `v` character |
|
||||
| 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 |
|
||||
|
||||
## 💕 Contributing
|
||||
|
||||
|
||||
25
action.yml
25
action.yml
@@ -25,13 +25,34 @@ outputs:
|
||||
value: ${{ steps.version-lookup.outputs.current-version }}
|
||||
current-v-version:
|
||||
description: 'Current normal version detected, prefixed with a `v` charatcter'
|
||||
value: v${{ steps.version-lookup.outputs.current-version }}
|
||||
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: v${{ steps.version-increment.outputs.version }}
|
||||
value: ${{ steps.version-increment.outputs.v-version }}
|
||||
major-version:
|
||||
description: 'Major number of the incremented version'
|
||||
value: ${{ steps.version-increment.outputs.major-version }}
|
||||
minor-version:
|
||||
description: 'Minor number of the incremented version'
|
||||
value: ${{ steps.version-increment.outputs.minor-version }}
|
||||
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 }}
|
||||
minor-v-version:
|
||||
description: 'Minor number of the incremented version, prefixed with a `v` charatcter'
|
||||
value: ${{ steps.version-increment.outputs.minor-v-version }}
|
||||
patch-v-version:
|
||||
description: 'Patch number of the incremented version, prefixed with a `v` charatcter'
|
||||
value: ${{ steps.version-increment.outputs.patch-v-version }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
||||
@@ -75,6 +75,9 @@ function init_repo {
|
||||
|
||||
print_run_info
|
||||
[ "$status" -eq 0 ] &&
|
||||
[[ "$output" = *"::set-output name=major-version::1"* ]] &&
|
||||
[[ "$output" = *"::set-output name=minor-version::2"* ]] &&
|
||||
[[ "$output" = *"::set-output name=patch-version::4"* ]] &&
|
||||
[[ "$output" = *"::set-output name=version::1.2.4"* ]]
|
||||
}
|
||||
|
||||
@@ -88,6 +91,9 @@ function init_repo {
|
||||
|
||||
print_run_info
|
||||
[ "$status" -eq 0 ] &&
|
||||
[[ "$output" = *"::set-output name=major-version::1"* ]] &&
|
||||
[[ "$output" = *"::set-output name=minor-version::3"* ]] &&
|
||||
[[ "$output" = *"::set-output name=patch-version::0"* ]] &&
|
||||
[[ "$output" = *"::set-output name=version::1.3.0"* ]]
|
||||
}
|
||||
|
||||
@@ -101,6 +107,9 @@ function init_repo {
|
||||
|
||||
print_run_info
|
||||
[ "$status" -eq 0 ] &&
|
||||
[[ "$output" = *"::set-output name=major-version::2"* ]] &&
|
||||
[[ "$output" = *"::set-output name=minor-version::0"* ]] &&
|
||||
[[ "$output" = *"::set-output name=patch-version::0"* ]] &&
|
||||
[[ "$output" = *"::set-output name=version::2.0.0"* ]]
|
||||
}
|
||||
|
||||
@@ -115,6 +124,9 @@ function init_repo {
|
||||
print_run_info
|
||||
[ "$status" -eq 0 ] &&
|
||||
[[ "$output" = *"::set-output name=version::2.0.0"* ]] &&
|
||||
[[ "$output" = *"::set-output name=major-v-version::v2"* ]] &&
|
||||
[[ "$output" = *"::set-output name=minor-v-version::v0"* ]] &&
|
||||
[[ "$output" = *"::set-output name=patch-v-version::v0"* ]] &&
|
||||
[[ "$output" = *"::set-output name=v-version::v2.0.0"* ]]
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -88,3 +90,9 @@ echo "ℹ️ The new version is ${new_version}"
|
||||
|
||||
echo "::set-output name=version::${new_version}"
|
||||
echo "::set-output name=v-version::v${new_version}"
|
||||
echo "::set-output name=major-version::${version_array[0]}"
|
||||
echo "::set-output name=minor-version::${version_array[1]}"
|
||||
echo "::set-output name=patch-version::${version_array[2]}"
|
||||
echo "::set-output name=major-v-version::v${version_array[0]}"
|
||||
echo "::set-output name=minor-v-version::v${version_array[1]}"
|
||||
echo "::set-output name=patch-v-version::v${version_array[2]}"
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# Skip if testing, otherwise pull tags
|
||||
if [[ -z "${BATS_VERSION:-}" ]] ; then
|
||||
git fetch --quiet origin 'refs/tags/*:refs/tags/*'
|
||||
git fetch --quiet --force origin 'refs/tags/*:refs/tags/*'
|
||||
fi
|
||||
|
||||
##==----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user