From 8b854651df1d2c00724a98804f4eac7355acbeda Mon Sep 17 00:00:00 2001 From: karunasa Date: Thu, 10 Feb 2022 16:56:32 +1100 Subject: [PATCH] Exposing major, minor and patch numbers as outputs --- README.md | 5 ++++- action.yml | 9 +++++++++ version-increment.sh | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 25c6ac9..2a1b53e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ uses: actions/checkout@v2 - name: Get next version - uses: reecetech/version-increment@2022.2.3 + uses: reecetech/version-increment@2022.2.4 id: version with: scheme: semver @@ -88,6 +88,9 @@ 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 | ## 💕 Contributing diff --git a/action.yml b/action.yml index e157f87..eec63da 100644 --- a/action.yml +++ b/action.yml @@ -32,6 +32,15 @@ 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 }} runs: using: "composite" diff --git a/version-increment.sh b/version-increment.sh index f8c29b7..ebf7cee 100755 --- a/version-increment.sh +++ b/version-increment.sh @@ -88,3 +88,6 @@ 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::v${version_array[0]}" +echo "::set-output name=minor-version::v${version_array[1]}" +echo "::set-output name=patch-version::v${version_array[2]}"