From 9ca8072ab6335e50852d32339823ece07f5cf83b Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 22 Nov 2022 14:45:49 +0100 Subject: [PATCH] Rename workflow and add type output --- .../{get-version-info.yml => get-version.yml} | 15 +++++++++++++++ 1 file changed, 15 insertions(+) rename .github/workflows/{get-version-info.yml => get-version.yml} (76%) diff --git a/.github/workflows/get-version-info.yml b/.github/workflows/get-version.yml similarity index 76% rename from .github/workflows/get-version-info.yml rename to .github/workflows/get-version.yml index 1aa97b60a..e4f49bf74 100644 --- a/.github/workflows/get-version-info.yml +++ b/.github/workflows/get-version.yml @@ -17,6 +17,9 @@ on: revNum: description: "The revision number" value: ${{ jobs.determine-version.outputs.revNum}} + versionType: + description: "Type of the version. Values are [stable, alpha, beta, rc, unknown]" + value: ${{ jobs.determine-version.outputs.type }} env: JAVA_VERSION: 19 @@ -31,6 +34,7 @@ jobs: semVerNum: ${{ steps.versions.outputs.semVerNum }} semVerStr: ${{ steps.versions.outputs.semVerStr }} revNum: ${{ steps.versions.outputs.revNum }} + type: ${{ steps.versions.outputs.type}} steps: - uses: actions/checkout@v3 with: @@ -53,9 +57,20 @@ jobs: fi SEM_VER_NUM=`echo ${SEM_VER_STR} | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/'` REVCOUNT=`git rev-list --count HEAD` + TYPE="unknown" + if [[ $SEM_VER_STR =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then + TYPE="stable" + elif [[ $SEM_VER_STR =~ [0-9]+\.[0-9]+\.[0-9]+-alpha[1-9] ]]; then + TYPE="alpha" + elif [[ $SEM_VER_STR =~ [0-9]+\.[0-9]+\.[0-9]+-beta[1-9] ]]; then + TYPE="beta" + elif [[ $SEM_VER_STR =~ [0-9]+\.[0-9]+\.[0-9]+-rc[1-9] ]]; then + TYPE="rc" + fi echo "::set-output name=semVerStr::${SEM_VER_STR}" echo "::set-output name=semVerNum::${SEM_VER_NUM}" echo "::set-output name=revNum::${REVCOUNT}" + echo "::set-output name=type::${TYPE}" - name: Validate Version uses: skymatic/semver-validation-action@v1 with: