strip non-numerical suffix from version number

This commit is contained in:
Sebastian Stenzel
2021-08-13 10:52:07 +02:00
parent 7b8ddbd8d7
commit 2fcff5fb17

View File

@@ -3,8 +3,9 @@ name: Installers and Release
on:
workflow_dispatch:
push:
tags:
- '*'
tags: # see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
env:
JAVA_VERSION: 16
@@ -80,8 +81,9 @@ jobs:
- id: versions
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION_NUM=`echo ${GITHUB_REF##*/} | sed -E 's/([0-9]+\.[0-9]+\.[0-9]+).*/\1/'`
echo "::set-output name=versionStr::${GITHUB_REF##*/}"
echo "::set-output name=versionNum::${GITHUB_REF##*/}"
echo "::set-output name=versionNum::${VERSION_NUM}"
else
echo "::set-output name=versionStr::SNAPSHOT"
echo "::set-output name=versionNum::99.0.0"