Updated ci
Some checks failed
Build on push / prepare (push) Successful in 9s
Build on push / core (push) Failing after 7s
Build on push / query (push) Failing after 7s

This commit is contained in:
2025-09-15 17:09:10 +02:00
parent 4719c32457
commit 68383d1893
3 changed files with 36 additions and 15 deletions

View File

@@ -3,11 +3,22 @@ run-name: Prepare Build Version
on:
workflow_call:
inputs:
version_suffix:
description: 'Suffix for version (z.B. "dev", "alpha", "beta")'
required: false
type: string
working_directory:
required: true
type: string
jobs:
prepare:
runs-on: [ runner ]
container: git.sh-edraft.de/sh-edraft.de/act-runner:latest
defaults:
run:
working-directory: ${{ inputs.working_directory }}
steps:
- name: Clone Repository
uses: https://github.com/actions/checkout@v3
@@ -21,7 +32,18 @@ jobs:
DATE=$(date +'%Y.%m.%d')
TAG_COUNT=$(git tag -l "${DATE}.*" | wc -l)
BUILD_NUMBER=$(($TAG_COUNT + 1))
BUILD_VERSION="${DATE}.${BUILD_NUMBER}.dev1"
VERSION_SUFFIX="${{ inputs.version_suffix }}"
if [ -n "$VERSION_SUFFIX" ] && [[ "$VERSION_SUFFIX" == "dev"* ]]; then
DEV_NUMBER=$(echo "$VERSION_SUFFIX" | sed -E 's/dev([0-9]*)/\1/')
DEV_NUMBER=${DEV_NUMBER:-1}
BUILD_VERSION="${DATE}.${BUILD_NUMBER}dev${DEV_NUMBER}"
elif [ -n "$VERSION_SUFFIX" ]; then
BUILD_VERSION="${DATE}.${BUILD_NUMBER}${VERSION_SUFFIX}"
else
BUILD_VERSION="${DATE}.${BUILD_NUMBER}"
fi
echo "$BUILD_VERSION" > version.txt
echo "VERSION $BUILD_VERSION"