mirror of
https://github.com/reecetech/version-increment.git
synced 2025-12-21 14:35:44 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d4fc14ad5 | ||
|
|
1d159768e8 | ||
|
|
69cfa4fa80 | ||
|
|
b9bae4a2dc | ||
|
|
53a0819e66 | ||
|
|
e53268eb3f | ||
|
|
8d649fcfa3 | ||
|
|
ccbbbe93a8 | ||
|
|
ddbbe72b7f | ||
|
|
ba14b463c4 | ||
|
|
fde70f2da9 | ||
|
|
8b854651df |
16
.github/workflows/test-and-release.yml
vendored
16
.github/workflows/test-and-release.yml
vendored
@@ -13,10 +13,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run ShellCheck
|
||||
uses: ludeeus/action-shellcheck@94e0aab03ca135d11a35e5bfc14e6746dc56e7e9
|
||||
uses: ludeeus/action-shellcheck@94e0aab03ca135d11a35e5bfc14e6746dc56e7e9 # v1.1.0
|
||||
with:
|
||||
check_together: 'yes'
|
||||
|
||||
@@ -24,12 +24,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup bats
|
||||
uses: mig4/setup-bats@af9a00deb21b5d795cabfeaa8d9060410377686d
|
||||
uses: mig4/setup-bats@af9a00deb21b5d795cabfeaa8d9060410377686d # v1.2.0
|
||||
with:
|
||||
bats-version: 1.4.1
|
||||
bats-version: 1.8.0
|
||||
|
||||
- name: Test
|
||||
run: bats tests/*.bats
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Lookup version
|
||||
id: version-lookup
|
||||
@@ -55,8 +55,8 @@ jobs:
|
||||
scheme: calver
|
||||
|
||||
- name: Release version
|
||||
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
uses: marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0 # v1.2.1
|
||||
if: ${{ github.ref_name == github.event.repository.default_branch }}
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
draft: false
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get next version
|
||||
uses: reecetech/version-increment@2022.2.3
|
||||
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
|
||||
|
||||
|
||||
21
action.yml
21
action.yml
@@ -32,6 +32,27 @@ outputs:
|
||||
v-version:
|
||||
description: 'Incremented version calculated, prefixed with a `v` charatcter'
|
||||
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