Using cut to increment version #27

Merged
hitanshu merged 1 commits from hitanshu/CFTunnels:tags into test 2025-06-05 16:29:56 +00:00
Showing only changes of commit 005863c998 - Show all commits

View File

@ -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