mirror of
https://github.com/reecetech/version-increment.git
synced 2025-12-21 06:25:44 +00:00
Merge pull request #9 from reecetech/v-prefix
Add `v` prefixed version output
This commit is contained in:
12
README.md
12
README.md
@@ -9,7 +9,7 @@
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Get next version
|
- name: Get next version
|
||||||
uses: reecetech/version-increment@2021.11.1
|
uses: reecetech/version-increment@2021.11.2
|
||||||
id: version
|
id: version
|
||||||
with:
|
with:
|
||||||
scheme: semver
|
scheme: semver
|
||||||
@@ -82,10 +82,12 @@ Examples:
|
|||||||
|
|
||||||
### 📤 Outputs
|
### 📤 Outputs
|
||||||
|
|
||||||
| name | description |
|
| name | description |
|
||||||
| :--- | :--- |
|
| :--- | :--- |
|
||||||
| current_version | The current latest version detected from the git repositories tags |
|
| current-version | The current latest version detected from the git repositories tags |
|
||||||
| version | The incremented version number (e.g. the next version) |
|
| 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 |
|
||||||
|
|
||||||
## 💕 Contributing
|
## 💕 Contributing
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,20 @@ function init_repo {
|
|||||||
[[ "$output" = *"::set-output name=version::2.0.0"* ]]
|
[[ "$output" = *"::set-output name=version::2.0.0"* ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "prefixes with v" {
|
||||||
|
init_repo
|
||||||
|
|
||||||
|
export current_version=1.2.3
|
||||||
|
export increment="major"
|
||||||
|
|
||||||
|
run ../../version-increment.sh
|
||||||
|
|
||||||
|
print_run_info
|
||||||
|
[ "$status" -eq 0 ] &&
|
||||||
|
[[ "$output" = *"::set-output name=version::2.0.0"* ]] &&
|
||||||
|
[[ "$output" = *"::set-output name=v-version::v2.0.0"* ]]
|
||||||
|
}
|
||||||
|
|
||||||
@test "increments to a new month (calver)" {
|
@test "increments to a new month (calver)" {
|
||||||
init_repo
|
init_repo
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,19 @@ function init_repo {
|
|||||||
[[ "$output" = *"::set-output name=current-version::0.1.2"* ]]
|
[[ "$output" = *"::set-output name=current-version::0.1.2"* ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "prefixes with a v" {
|
||||||
|
init_repo
|
||||||
|
|
||||||
|
git tag 0.1.2
|
||||||
|
|
||||||
|
run ../../version-lookup.sh
|
||||||
|
|
||||||
|
print_run_info
|
||||||
|
[ "$status" -eq 0 ] &&
|
||||||
|
[[ "$output" = *"::set-output name=current-version::0.1.2"* ]] &&
|
||||||
|
[[ "$output" = *"::set-output name=current-v-version::v0.1.2"* ]]
|
||||||
|
}
|
||||||
|
|
||||||
@test "finds the current normal version even if there's a newer pre-release version" {
|
@test "finds the current normal version even if there's a newer pre-release version" {
|
||||||
init_repo
|
init_repo
|
||||||
|
|
||||||
|
|||||||
@@ -87,3 +87,4 @@ fi
|
|||||||
echo "ℹ️ The new version is ${new_version}"
|
echo "ℹ️ The new version is ${new_version}"
|
||||||
|
|
||||||
echo "::set-output name=version::${new_version}"
|
echo "::set-output name=version::${new_version}"
|
||||||
|
echo "::set-output name=v-version::v${new_version}"
|
||||||
|
|||||||
@@ -62,3 +62,4 @@ fi
|
|||||||
echo "ℹ️ The current normal version is ${current_version}"
|
echo "ℹ️ The current normal version is ${current_version}"
|
||||||
|
|
||||||
echo "::set-output name=current-version::${current_version}"
|
echo "::set-output name=current-version::${current_version}"
|
||||||
|
echo "::set-output name=current-v-version::v${current_version}"
|
||||||
|
|||||||
Reference in New Issue
Block a user