From 005863c9988a90a9c79f07c2e982e868de736251 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 21:45:30 +0530 Subject: [PATCH] Using cut to increment version --- .gitea/workflows/test_image_build_push.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index f74f74f..18792f0 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -18,14 +18,18 @@ jobs: with: distribution: 'zulu' java-version: '17' - - name: Install AWK - run: sudo apt-get update && sudo apt-get install -y gawk - name: Validate Gradle Wrapper uses: gradle/actions/wrapper-validation@v3 - name: Get latest tag - run: echo "VERSION=$(git describe --tags --abbrev=0)" + run: | + echo "VERSION=$(git describe --tags --abbrev=0)" + MAJOR=$(echo $VERSION | cut -d "." -f 1) + MINOR=$(echo $VERSION | cut -d "." -f 2) + PATCH=$(echo $VERSION | cut -d "." -f 3) - name: Increment version - run: echo "NEW_VERSION=$(echo $VERSION | awk -F'v' '{print $2}' | awk -F. '{print "v"$1"."$2"."$3+1}')" + run: | + PATCH=$((PATCH + 1)) + echo "NEW_VERSION=$(echo $MAJOR.$MINOR.$PATCH)" - name: Extract commit message run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" - name: Create and push tag -- 2.45.2