From 5fb59032cb8c88aa50f7808a6a380a5a4ccc9e94 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 01:52:45 +0530 Subject: [PATCH 01/40] Adding tags to release and images --- .gitea/workflows/test_image_build_push.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index e4cdd2f..96b71d2 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -18,6 +18,16 @@ jobs: java-version: '17' - name: Validate Gradle Wrapper uses: gradle/actions/wrapper-validation@v3 + - name: Get latest tag + run: echo "VERSION=$(git describe --tags --abbrev=0)" + - name: Increment version + run: echo "NEW_VERSION=$(echo $VERSION | awk -F'v' '{print $2}' | awk -F. '{print "v"$1"."$2"."$3+1}')" + - name: Extract commit message + run: echo "COMMIT_MESSAGE=$((git log -1 --pretty=%B)" + - name: Create and push tag + run: | + git tag -a ${NEW_VERSION} -m "${COMMIT_MESSAGE}" + git push origin ${NEW_VERSION} - name: Log in to Gitea Docker Registry uses: docker/login-action@v3 with: @@ -25,6 +35,10 @@ jobs: username: hitanshu password: ${{ secrets.TOKEN }} - name: Gradle build - run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:test + run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} + - name: Tag image as test + run: docker tag 192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} 192.168.0.100:8928/hithomelabs/cftunnels:test - name: Push to Gitea Registry - run: docker push 192.168.0.100:8928/hithomelabs/cftunnels:test + run: | + docker push 192.168.0.100:8928/hithomelabs/cftunnels:test + docker push 192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} From 8f1f6e4f99dd0ceda6fe0c56ad0ca1abcfad6c06 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 01:59:40 +0530 Subject: [PATCH 02/40] Minor bugfix --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 96b71d2..6abc8a3 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -23,7 +23,7 @@ jobs: - name: Increment version run: echo "NEW_VERSION=$(echo $VERSION | awk -F'v' '{print $2}' | awk -F. '{print "v"$1"."$2"."$3+1}')" - name: Extract commit message - run: echo "COMMIT_MESSAGE=$((git log -1 --pretty=%B)" + run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" - name: Create and push tag run: | git tag -a ${NEW_VERSION} -m "${COMMIT_MESSAGE}" From b66ba60028795bf0b15821efd589e7a9e62558ab Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 02:19:59 +0530 Subject: [PATCH 03/40] Fetching tags explicitly --- .gitea/workflows/test_image_build_push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 6abc8a3..4bcfafc 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -26,6 +26,7 @@ jobs: run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" - name: Create and push tag run: | + git fetch --tags git tag -a ${NEW_VERSION} -m "${COMMIT_MESSAGE}" git push origin ${NEW_VERSION} - name: Log in to Gitea Docker Registry From f6bd7573a6a85283067a5f0e429dec2b22a47598 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 02:29:02 +0530 Subject: [PATCH 04/40] using fetch-depth 0 as specified in https://github.com/actions/checkout/issues/1781 --- .gitea/workflows/test_image_build_push.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 4bcfafc..4130c59 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -11,6 +11,8 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: JDK setup uses: actions/setup-java@v4 with: @@ -26,7 +28,6 @@ jobs: run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" - name: Create and push tag run: | - git fetch --tags git tag -a ${NEW_VERSION} -m "${COMMIT_MESSAGE}" git push origin ${NEW_VERSION} - name: Log in to Gitea Docker Registry From 1cd63d6d3d48a6489152f8628b54a96f49ce5a0a Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 02:36:19 +0530 Subject: [PATCH 05/40] Adding awk --- .gitea/workflows/test_image_build_push.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 4130c59..f74f74f 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -18,6 +18,8 @@ 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 From 005863c9988a90a9c79f07c2e982e868de736251 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 21:45:30 +0530 Subject: [PATCH 06/40] 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 From 3bf981ac05c21965a193a730fdbba8074b5ee3a2 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 22:05:51 +0530 Subject: [PATCH 07/40] Checking if cut is installed on gitea runner --- .gitea/workflows/test_image_build_push.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 18792f0..b035c3b 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -20,12 +20,14 @@ jobs: java-version: '17' - name: Validate Gradle Wrapper uses: gradle/actions/wrapper-validation@v3 + - name: Check if cut is installed + run: echo $(which cut) - name: Get latest tag 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) + echo "MAJOR=$(echo $VERSION | cut -d "." -f 1)" + echo "MINOR=$(echo $VERSION | cut -d "." -f 2)" + echo "PATCH=$(echo $VERSION | cut -d "." -f 3)" - name: Increment version run: | PATCH=$((PATCH + 1)) From 3742fb53af916a9e43eaa5d6d05f70c101ee5a9b Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 23:13:27 +0530 Subject: [PATCH 08/40] Trying a different base image --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index b035c3b..aa75baf 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -7,7 +7,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: catthehacker/ubuntu:act-latest + image: catthehacker/ubuntu:runner-latest steps: - name: Check out repository code uses: actions/checkout@v4 From ccc65aef8d9b4828e1aeebfc3dd81e845e2d0d0f Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 23:23:44 +0530 Subject: [PATCH 09/40] Trying to figure out RCA --- .gitea/workflows/test_build.yml | 7 +++++++ .gitea/workflows/test_image_build_push.yml | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test_build.yml b/.gitea/workflows/test_build.yml index ae070cd..a546543 100644 --- a/.gitea/workflows/test_build.yml +++ b/.gitea/workflows/test_build.yml @@ -15,6 +15,13 @@ jobs: distribution: 'zulu' java-version: '17' - name: Validate Gradle Wrapper + - name: Get latest tag dry run + run: | + echo "VERSION=$(git describe --tags --abbrev=0)" + echo $VERSION + echo "MAJOR=$(echo $VERSION | cut -d "." -f 1)" + echo "MINOR=$(echo $VERSION | cut -d "." -f 2)" + echo "PATCH=$(echo $VERSION | cut -d "." -f 3)" uses: gradle/actions/wrapper-validation@v3 - name: Gradle build run: ./gradlew build --info \ No newline at end of file diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index aa75baf..3feddd2 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -7,7 +7,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: catthehacker/ubuntu:runner-latest + image: catthehacker/ubuntu:act-latest steps: - name: Check out repository code uses: actions/checkout@v4 @@ -25,6 +25,7 @@ jobs: - name: Get latest tag run: | echo "VERSION=$(git describe --tags --abbrev=0)" + echo $VERSION echo "MAJOR=$(echo $VERSION | cut -d "." -f 1)" echo "MINOR=$(echo $VERSION | cut -d "." -f 2)" echo "PATCH=$(echo $VERSION | cut -d "." -f 3)" From 36050aec95f171f1ce26149fbab6396e7e8c1de2 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 23:26:25 +0530 Subject: [PATCH 10/40] Trying to figure out RCA --- .gitea/workflows/test_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_build.yml b/.gitea/workflows/test_build.yml index a546543..85e9353 100644 --- a/.gitea/workflows/test_build.yml +++ b/.gitea/workflows/test_build.yml @@ -15,6 +15,7 @@ jobs: distribution: 'zulu' java-version: '17' - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v3 - name: Get latest tag dry run run: | echo "VERSION=$(git describe --tags --abbrev=0)" @@ -22,6 +23,5 @@ jobs: echo "MAJOR=$(echo $VERSION | cut -d "." -f 1)" echo "MINOR=$(echo $VERSION | cut -d "." -f 2)" echo "PATCH=$(echo $VERSION | cut -d "." -f 3)" - uses: gradle/actions/wrapper-validation@v3 - name: Gradle build run: ./gradlew build --info \ No newline at end of file From c6ded4a74d5de69c6e122571f80eb8c2062a1700 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Thu, 5 Jun 2025 23:43:57 +0530 Subject: [PATCH 11/40] Trying to figure out RCA --- .gitea/workflows/test_build.yml | 7 ------- .gitea/workflows/test_image_build_push.yml | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/test_build.yml b/.gitea/workflows/test_build.yml index 85e9353..ae070cd 100644 --- a/.gitea/workflows/test_build.yml +++ b/.gitea/workflows/test_build.yml @@ -16,12 +16,5 @@ jobs: java-version: '17' - name: Validate Gradle Wrapper uses: gradle/actions/wrapper-validation@v3 - - name: Get latest tag dry run - run: | - echo "VERSION=$(git describe --tags --abbrev=0)" - echo $VERSION - echo "MAJOR=$(echo $VERSION | cut -d "." -f 1)" - echo "MINOR=$(echo $VERSION | cut -d "." -f 2)" - echo "PATCH=$(echo $VERSION | cut -d "." -f 3)" - name: Gradle build run: ./gradlew build --info \ No newline at end of file diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 3feddd2..c6f314b 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -26,8 +26,8 @@ jobs: run: | echo "VERSION=$(git describe --tags --abbrev=0)" echo $VERSION - echo "MAJOR=$(echo $VERSION | cut -d "." -f 1)" - echo "MINOR=$(echo $VERSION | cut -d "." -f 2)" + echo "MAJOR=$(echo $VERSION | /usr/bin/cut -d "." -f 1)" + sudo echo "MINOR=$(echo $VERSION | cut -d "." -f 2)" echo "PATCH=$(echo $VERSION | cut -d "." -f 3)" - name: Increment version run: | From df2a50d356fb055e8de7b83c0510fabbe97f4273 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 00:02:30 +0530 Subject: [PATCH 12/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index c6f314b..492ed6e 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -25,10 +25,10 @@ jobs: - name: Get latest tag run: | echo "VERSION=$(git describe --tags --abbrev=0)" - echo $VERSION - echo "MAJOR=$(echo $VERSION | /usr/bin/cut -d "." -f 1)" - sudo echo "MINOR=$(echo $VERSION | cut -d "." -f 2)" - echo "PATCH=$(echo $VERSION | cut -d "." -f 3)" + echo "${VERSION}" + echo "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" + sudo echo "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" + echo "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" - name: Increment version run: | PATCH=$((PATCH + 1)) From cc64b7c74872c33c1e5538c7f9705a1f1a71a33b Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 00:30:25 +0530 Subject: [PATCH 13/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 27 +++++++--------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 492ed6e..250d553 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -18,27 +18,16 @@ jobs: with: distribution: 'zulu' java-version: '17' - - name: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@v3 - - name: Check if cut is installed - run: echo $(which cut) - - name: Get latest tag - run: | - echo "VERSION=$(git describe --tags --abbrev=0)" - echo "${VERSION}" - echo "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" - sudo echo "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" - echo "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" - - name: Increment version - 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: Get Next Patch Version + id: version + uses: reecetech/version-increment@v2024.10.1 + with: + scheme: semver + increment: patch - name: Create and push tag run: | - git tag -a ${NEW_VERSION} -m "${COMMIT_MESSAGE}" - git push origin ${NEW_VERSION} + git tag -a ${{ steps.version.outputs.version }} -m "Tagging with ${{ steps.version.outputs.version }}" + git push origin ${{ steps.version.outputs.version }} - name: Log in to Gitea Docker Registry uses: docker/login-action@v3 with: From 61df434e0da719efd10a2dc886544b3db8d20ff8 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 00:31:06 +0530 Subject: [PATCH 14/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 250d553..5693c1b 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -35,10 +35,10 @@ jobs: username: hitanshu password: ${{ secrets.TOKEN }} - name: Gradle build - run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} + run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.version.outputs.version }} - name: Tag image as test - run: docker tag 192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} 192.168.0.100:8928/hithomelabs/cftunnels:test + run: docker tag 192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.version.outputs.version }} 192.168.0.100:8928/hithomelabs/cftunnels:test - name: Push to Gitea Registry run: | docker push 192.168.0.100:8928/hithomelabs/cftunnels:test - docker push 192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} + docker push 192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.version.outputs.version }} From 80b55fd993139bf38662c40854b8ee5a8175c335 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 00:48:35 +0530 Subject: [PATCH 15/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 31 ++++++++++++++-------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 5693c1b..a7f80aa 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -18,16 +18,25 @@ jobs: with: distribution: 'zulu' java-version: '17' - - name: Get Next Patch Version - id: version - uses: reecetech/version-increment@v2024.10.1 - with: - scheme: semver - increment: patch + - name: Check if cut is installed + run: echo $(which cut) + - name: Get latest tag + run: | + export "VERSION=$(git describe --tags --abbrev=0)" >> $GITEA_OUTPUT + echo "${GITEA_OUTPUT}" + echo "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" + sudo echo "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" + echo "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" + - name: Increment version + 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 run: | - git tag -a ${{ steps.version.outputs.version }} -m "Tagging with ${{ steps.version.outputs.version }}" - git push origin ${{ steps.version.outputs.version }} + git tag -a ${NEW_VERSION} -m "${COMMIT_MESSAGE}" + git push origin ${NEW_VERSION} - name: Log in to Gitea Docker Registry uses: docker/login-action@v3 with: @@ -35,10 +44,10 @@ jobs: username: hitanshu password: ${{ secrets.TOKEN }} - name: Gradle build - run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.version.outputs.version }} + run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} - name: Tag image as test - run: docker tag 192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.version.outputs.version }} 192.168.0.100:8928/hithomelabs/cftunnels:test + run: docker tag 192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} 192.168.0.100:8928/hithomelabs/cftunnels:test - name: Push to Gitea Registry run: | docker push 192.168.0.100:8928/hithomelabs/cftunnels:test - docker push 192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.version.outputs.version }} + docker push 192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} From 0bc90d5d773a94baec457b13f6bcd08056a9a74d Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 01:07:33 +0530 Subject: [PATCH 16/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index a7f80aa..217374d 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -24,9 +24,12 @@ jobs: run: | export "VERSION=$(git describe --tags --abbrev=0)" >> $GITEA_OUTPUT echo "${GITEA_OUTPUT}" - echo "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" - sudo echo "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" - echo "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" + export "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" + echo "${MAJOR}" + export "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" + echo "${MINOR}" + export "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" + echo "${PATCH} - name: Increment version run: | PATCH=$((PATCH + 1)) From 4afeb9f6b2249ec50e081d064220661147df9ec0 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 01:11:09 +0530 Subject: [PATCH 17/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 217374d..dace717 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -22,14 +22,14 @@ jobs: run: echo $(which cut) - name: Get latest tag run: | - export "VERSION=$(git describe --tags --abbrev=0)" >> $GITEA_OUTPUT - echo "${GITEA_OUTPUT}" + export "VERSION=$(git describe --tags --abbrev=0)" + echo "${VERSION}" export "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" echo "${MAJOR}" export "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" echo "${MINOR}" export "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" - echo "${PATCH} + echo "${PATCH}" - name: Increment version run: | PATCH=$((PATCH + 1)) From c045dae894cb82e3a8d4c8b1f2fb5812586e2f66 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 01:33:41 +0530 Subject: [PATCH 18/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index dace717..317c324 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -18,22 +18,21 @@ jobs: with: distribution: 'zulu' java-version: '17' - - name: Check if cut is installed - run: echo $(which cut) - name: Get latest tag + id: get_tag run: | export "VERSION=$(git describe --tags --abbrev=0)" echo "${VERSION}" export "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" - echo "${MAJOR}" + echo "MAJOR=${MAJOR}" export "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" - echo "${MINOR}" + echo "MINOR=${MINOR}" export "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" - echo "${PATCH}" + echo "PATCH=${PATCH}" - name: Increment version run: | - PATCH=$((PATCH + 1)) - echo "NEW_VERSION=$(echo $MAJOR.$MINOR.$PATCH)" + export "NEW_VERSION=$(echo ${{ steps.get_tag.outputs.MAJOR }}.${{ steps.get_tag.outputs.MINOR }}.$( ${{ steps.get_tag.outputs.PATCH }} + 1) ) + echo "NEW_VERSION=${NEW_VERSION}" - name: Extract commit message run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" - name: Create and push tag From 27576d6023096f34173f83a47a2b3bde7c1d172b Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 01:36:57 +0530 Subject: [PATCH 19/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 317c324..6bc41d8 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -31,7 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | - export "NEW_VERSION=$(echo ${{ steps.get_tag.outputs.MAJOR }}.${{ steps.get_tag.outputs.MINOR }}.$( ${{ steps.get_tag.outputs.PATCH }} + 1) ) + export "NEW_VERSION=$(echo ${{ steps.get_tag.outputs.MAJOR }}.${{ steps.get_tag.outputs.MINOR }}.$( ${{ steps.get_tag.outputs.PATCH }} + 1) )" echo "NEW_VERSION=${NEW_VERSION}" - name: Extract commit message run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" From 7203877b27771111800ea39e21b221ac304e19be Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 01:41:34 +0530 Subject: [PATCH 20/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 6bc41d8..998c7c7 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -31,7 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | - export "NEW_VERSION=$(echo ${{ steps.get_tag.outputs.MAJOR }}.${{ steps.get_tag.outputs.MINOR }}.$( ${{ steps.get_tag.outputs.PATCH }} + 1) )" + export "NEW_VERSION=$(echo ${{ steps.get_tag.outputs.MAJOR }}.${{ steps.get_tag.outputs.MINOR }}.${{ steps.get_tag.outputs.PATCH }})" echo "NEW_VERSION=${NEW_VERSION}" - name: Extract commit message run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" From 856748edb77ce1d249c12bcc342a0b87b1e03437 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 01:46:54 +0530 Subject: [PATCH 21/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 998c7c7..30b431a 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -31,7 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | - export "NEW_VERSION=$(echo ${{ steps.get_tag.outputs.MAJOR }}.${{ steps.get_tag.outputs.MINOR }}.${{ steps.get_tag.outputs.PATCH }})" + export "NEW_VERSION=${{ steps.get_tag.outputs.MAJOR }}" echo "NEW_VERSION=${NEW_VERSION}" - name: Extract commit message run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" From c24abc76be63cd58189ae03ddfc1480976bde93e Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 01:54:20 +0530 Subject: [PATCH 22/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 30b431a..99f6a46 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -21,7 +21,7 @@ jobs: - name: Get latest tag id: get_tag run: | - export "VERSION=$(git describe --tags --abbrev=0)" + export "VERSION=$(git describe --tags --abbrev=0)" >> $GITEA_ENV echo "${VERSION}" export "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" echo "MAJOR=${MAJOR}" @@ -31,8 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | - export "NEW_VERSION=${{ steps.get_tag.outputs.MAJOR }}" - echo "NEW_VERSION=${NEW_VERSION}" + cat $GITEA_ENV - name: Extract commit message run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" - name: Create and push tag From 05214000af88a83507ffc65e7fab79a65032205e Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 02:02:19 +0530 Subject: [PATCH 23/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 99f6a46..51d6af2 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -23,15 +23,17 @@ jobs: run: | export "VERSION=$(git describe --tags --abbrev=0)" >> $GITEA_ENV echo "${VERSION}" - export "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" + export "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" >> $GITEA_ENV echo "MAJOR=${MAJOR}" - export "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" + export "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" >> $GITEA_ENV echo "MINOR=${MINOR}" - export "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" + export "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" >> $GITEA_ENV echo "PATCH=${PATCH}" - name: Increment version run: | - cat $GITEA_ENV + export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV + export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV + echo "NEW_VERSION=${NEW_VERSION}" - name: Extract commit message run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" - name: Create and push tag From 5760f9e7141f85c9b8a777b7fe9d3569f349bcda Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 02:06:12 +0530 Subject: [PATCH 24/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 51d6af2..b302553 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -31,6 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | + echo "MAJOR=${MAJOR}" export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV echo "NEW_VERSION=${NEW_VERSION}" From d7cda65f2110dce372b77341e8620e7678c85178 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 02:11:28 +0530 Subject: [PATCH 25/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index b302553..641a094 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -31,7 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | - echo "MAJOR=${MAJOR}" + echo $GITEA_ENV export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV echo "NEW_VERSION=${NEW_VERSION}" From 2b0e0eb9c4318fe793eabcee073ce5bed7c88591 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 02:14:30 +0530 Subject: [PATCH 26/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 641a094..ebc6e00 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -31,7 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | - echo $GITEA_ENV + cat /var/run/act/workflow/envs.txt export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV echo "NEW_VERSION=${NEW_VERSION}" From 40a536ddcfd16bb23bc900ac751b7ca1bd64d97e Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 02:19:18 +0530 Subject: [PATCH 27/40] Trying to figure out RCA --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index ebc6e00..a07f84a 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -31,7 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | - cat /var/run/act/workflow/envs.txt + source $GITEA_ENV export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV echo "NEW_VERSION=${NEW_VERSION}" From 38753791d71069952988a74672e6fe75765eaf81 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 02:20:03 +0530 Subject: [PATCH 28/40] Trying to figure out RCA --- .gitea/workflows/test_build.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitea/workflows/test_build.yml b/.gitea/workflows/test_build.yml index ae070cd..b991e53 100644 --- a/.gitea/workflows/test_build.yml +++ b/.gitea/workflows/test_build.yml @@ -16,5 +16,22 @@ jobs: java-version: '17' - name: Validate Gradle Wrapper uses: gradle/actions/wrapper-validation@v3 + - name: Get latest tag + id: get_tag + run: | + export "VERSION=$(git describe --tags --abbrev=0)" >> $GITEA_ENV + echo "${VERSION}" + export "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" >> $GITEA_ENV + echo "MAJOR=${MAJOR}" + export "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" >> $GITEA_ENV + echo "MINOR=${MINOR}" + export "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" >> $GITEA_ENV + echo "PATCH=${PATCH}" + - name: Increment version + run: | + source $GITEA_ENV + export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV + export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV + echo "NEW_VERSION=${NEW_VERSION}" - name: Gradle build run: ./gradlew build --info \ No newline at end of file From 1980b49272f9435fa57f90f85e8c5de3f17c93ae Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Fri, 6 Jun 2025 02:24:53 +0530 Subject: [PATCH 29/40] Trying to figure out RCA --- .gitea/workflows/test_build.yml | 4 +++- .gitea/workflows/test_image_build_push.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/test_build.yml b/.gitea/workflows/test_build.yml index b991e53..3817663 100644 --- a/.gitea/workflows/test_build.yml +++ b/.gitea/workflows/test_build.yml @@ -6,6 +6,8 @@ on: jobs: build: runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest steps: - name: Check out repository code uses: actions/checkout@v4 @@ -29,7 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | - source $GITEA_ENV + . $GITEA_ENV export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV echo "NEW_VERSION=${NEW_VERSION}" diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index a07f84a..d96fd01 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -31,7 +31,7 @@ jobs: echo "PATCH=${PATCH}" - name: Increment version run: | - source $GITEA_ENV + . $GITEA_ENV export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV echo "NEW_VERSION=${NEW_VERSION}" From cd4b2ae2d86de6dac2635941d374cea641252b11 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 21:21:39 +0530 Subject: [PATCH 30/40] Trying to pass variables between steps using outputs --- .gitea/workflows/test_build.yml | 19 ----------- .gitea/workflows/test_image_build_push.yml | 37 +++++++++++----------- 2 files changed, 18 insertions(+), 38 deletions(-) diff --git a/.gitea/workflows/test_build.yml b/.gitea/workflows/test_build.yml index 3817663..ae070cd 100644 --- a/.gitea/workflows/test_build.yml +++ b/.gitea/workflows/test_build.yml @@ -6,8 +6,6 @@ on: jobs: build: runs-on: ubuntu-latest - container: - image: catthehacker/ubuntu:act-latest steps: - name: Check out repository code uses: actions/checkout@v4 @@ -18,22 +16,5 @@ jobs: java-version: '17' - name: Validate Gradle Wrapper uses: gradle/actions/wrapper-validation@v3 - - name: Get latest tag - id: get_tag - run: | - export "VERSION=$(git describe --tags --abbrev=0)" >> $GITEA_ENV - echo "${VERSION}" - export "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" >> $GITEA_ENV - echo "MAJOR=${MAJOR}" - export "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" >> $GITEA_ENV - echo "MINOR=${MINOR}" - export "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" >> $GITEA_ENV - echo "PATCH=${PATCH}" - - name: Increment version - run: | - . $GITEA_ENV - export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV - export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV - echo "NEW_VERSION=${NEW_VERSION}" - name: Gradle build run: ./gradlew build --info \ No newline at end of file diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index d96fd01..425a819 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -18,29 +18,28 @@ jobs: with: distribution: 'zulu' java-version: '17' + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v3 - name: Get latest tag id: get_tag run: | - export "VERSION=$(git describe --tags --abbrev=0)" >> $GITEA_ENV - echo "${VERSION}" - export "MAJOR=$(echo ${VERSION} | /usr/bin/cut -d "." -f 1)" >> $GITEA_ENV - echo "MAJOR=${MAJOR}" - export "MINOR=$(echo ${VERSION} | cut -d "." -f 2)" >> $GITEA_ENV - echo "MINOR=${MINOR}" - export "PATCH=$(echo ${VERSION} | cut -d "." -f 3)" >> $GITEA_ENV - echo "PATCH=${PATCH}" + VERSION=$(git describe --tags --abbrev=0) + echo "VERSION=${VERSION}" >> $GITEA_OUTPUT + MAJOR=$(echo ${VERSION} | cut -d "." -f 1) + echo "MAJOR=${MAJOR}" >> $GITEA_OUTPUT + MINOR=$(echo ${VERSION} | cut -d "." -f 2) + echo "MINOR=${MINOR}" >> $GITEA_OUTPUT + PATCH=$(echo ${VERSION} | cut -d "." -f 3) + echo "PATCH=${PATCH}" >> $GITEA_OUTPUT - name: Increment version + id: calc_new_tag run: | - . $GITEA_ENV - export "PATCH=$((${PATCH} + 1))" >> $GITEA_ENV - export "NEW_VERSION=$(echo ${MAJOR}.${MINOR}.${PATCH})" >> $GITEA_ENV - echo "NEW_VERSION=${NEW_VERSION}" - - name: Extract commit message - run: echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" + echo "NEW_PATCH=$((${{ steps.get_id.outputs.PATCH }} + 1))" >> $GITEA_OUTPUT + echo "NEW_VERSION=$( ${{ steps.get_id.outputs.MAJOR }}.${{ steps.get_id.outputs.MINOR }}.${{ steps.get_id.outputs.NEW_PATCH }})" >> $GITEA_OUTPUT - name: Create and push tag run: | - git tag -a ${NEW_VERSION} -m "${COMMIT_MESSAGE}" - git push origin ${NEW_VERSION} + git tag -a ${{ steps.calc_new_tag.outputs.NEW_VERSION }} -m "Pushing new version ${{ steps.calc_new_tag.outputs.NEW_VERSION }}" + git push origin ${{ steps.calc_new_tag.outputs.NEW_VERSION }} - name: Log in to Gitea Docker Registry uses: docker/login-action@v3 with: @@ -48,10 +47,10 @@ jobs: username: hitanshu password: ${{ secrets.TOKEN }} - name: Gradle build - run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} + run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.calc_new_tag.outputs.NEW_VERSION }} - name: Tag image as test - run: docker tag 192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} 192.168.0.100:8928/hithomelabs/cftunnels:test + run: docker tag 192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.calc_new_tag.outputs.NEW_VERSION }} 192.168.0.100:8928/hithomelabs/cftunnels:test - name: Push to Gitea Registry run: | docker push 192.168.0.100:8928/hithomelabs/cftunnels:test - docker push 192.168.0.100:8928/hithomelabs/cftunnels:${NEW_VERSION} + docker push 192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.calc_new_tag.outputs.NEW_VERSION }} From 66fbfc5d69e69b30c39b9f47cabc7f4ddbef5aee Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 21:29:54 +0530 Subject: [PATCH 31/40] Trying to pass variables between steps using outputs --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 425a819..f4b42f1 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -35,7 +35,7 @@ jobs: id: calc_new_tag run: | echo "NEW_PATCH=$((${{ steps.get_id.outputs.PATCH }} + 1))" >> $GITEA_OUTPUT - echo "NEW_VERSION=$( ${{ steps.get_id.outputs.MAJOR }}.${{ steps.get_id.outputs.MINOR }}.${{ steps.get_id.outputs.NEW_PATCH }})" >> $GITEA_OUTPUT + echo "NEW_VERSION=$( ${{ steps.get_id.outputs.MAJOR }}.${{ steps.get_id.outputs.MINOR }}.${NEW_PATCH})" >> $GITEA_OUTPUT - name: Create and push tag run: | git tag -a ${{ steps.calc_new_tag.outputs.NEW_VERSION }} -m "Pushing new version ${{ steps.calc_new_tag.outputs.NEW_VERSION }}" From 8720810c46b5fb58aaecc1b5bd6dae2f3227467d Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 21:39:17 +0530 Subject: [PATCH 32/40] Trying to pass variables between steps using outputs --- .gitea/workflows/test_image_build_push.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index f4b42f1..b44a6f1 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -34,7 +34,8 @@ jobs: - name: Increment version id: calc_new_tag run: | - echo "NEW_PATCH=$((${{ steps.get_id.outputs.PATCH }} + 1))" >> $GITEA_OUTPUT + echo "${{ steps.get_id.outputs.PATCH }}" + echo "NEW_PATCH=$(( ${{ steps.get_id.outputs.PATCH }} + 1))" >> $GITEA_OUTPUT echo "NEW_VERSION=$( ${{ steps.get_id.outputs.MAJOR }}.${{ steps.get_id.outputs.MINOR }}.${NEW_PATCH})" >> $GITEA_OUTPUT - name: Create and push tag run: | From 6262c84535174dd1e6b7fdb132fd104715dbe26a Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 21:46:10 +0530 Subject: [PATCH 33/40] Trying to use --- .gitea/workflows/test_image_build_push.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index b44a6f1..1295a5f 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -24,19 +24,19 @@ jobs: id: get_tag run: | VERSION=$(git describe --tags --abbrev=0) - echo "VERSION=${VERSION}" >> $GITEA_OUTPUT + echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT MAJOR=$(echo ${VERSION} | cut -d "." -f 1) - echo "MAJOR=${MAJOR}" >> $GITEA_OUTPUT + echo "MAJOR=${MAJOR}" >> $GITHUB_OUTPUT MINOR=$(echo ${VERSION} | cut -d "." -f 2) - echo "MINOR=${MINOR}" >> $GITEA_OUTPUT + echo "MINOR=${MINOR}" >> $GITHUB_OUTPUT PATCH=$(echo ${VERSION} | cut -d "." -f 3) - echo "PATCH=${PATCH}" >> $GITEA_OUTPUT + echo "PATCH=${PATCH}" >> $GITHUB_OUTPUT - name: Increment version id: calc_new_tag run: | echo "${{ steps.get_id.outputs.PATCH }}" - echo "NEW_PATCH=$(( ${{ steps.get_id.outputs.PATCH }} + 1))" >> $GITEA_OUTPUT - echo "NEW_VERSION=$( ${{ steps.get_id.outputs.MAJOR }}.${{ steps.get_id.outputs.MINOR }}.${NEW_PATCH})" >> $GITEA_OUTPUT + echo "NEW_PATCH=$(( ${{ steps.get_id.outputs.PATCH }} + 1))" >> $GITHUB_OUTPUT + echo "NEW_VERSION=$( ${{ steps.get_id.outputs.MAJOR }}.${{ steps.get_id.outputs.MINOR }}.${NEW_PATCH})" >> $GITHUB_OUTPUT - name: Create and push tag run: | git tag -a ${{ steps.calc_new_tag.outputs.NEW_VERSION }} -m "Pushing new version ${{ steps.calc_new_tag.outputs.NEW_VERSION }}" From 5307ba0307169d96d6125d5759b7f7faec0f0385 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 23:14:11 +0530 Subject: [PATCH 34/40] Trying to use --- .gitea/workflows/test_image_build_push.yml | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 1295a5f..dec2b35 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -4,8 +4,25 @@ on: push: branches: [test] jobs: + tag: + runs-on: ubuntu-latest + outputs: + new_version: ${{ steps.new_version.outputs.new_version }} + steps: + id: new_version + run: | + VERSION=$(git describe --tags --abbrev=0) + echo ${VERSION} + MAJOR=$(echo ${VERSION} | cut -d "." -f 1) + MINOR=$(echo ${VERSION} | cut -d "." -f 2) + PATCH=$(echo ${VERSION} | cut -d "." -f 3) + NEW_PATCH=$(( ${PATCH} + 1)) + echo ${NEW_PATCH} + echo "new_version=$($MAJOR.$MINOR.$NEW_PATCH)" >> $GITHUB_OUTPUT + echo ${new_version} build: runs-on: ubuntu-latest + needs: tag container: image: catthehacker/ubuntu:act-latest steps: @@ -20,27 +37,10 @@ jobs: java-version: '17' - name: Validate Gradle Wrapper uses: gradle/actions/wrapper-validation@v3 - - name: Get latest tag - id: get_tag - run: | - VERSION=$(git describe --tags --abbrev=0) - echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - MAJOR=$(echo ${VERSION} | cut -d "." -f 1) - echo "MAJOR=${MAJOR}" >> $GITHUB_OUTPUT - MINOR=$(echo ${VERSION} | cut -d "." -f 2) - echo "MINOR=${MINOR}" >> $GITHUB_OUTPUT - PATCH=$(echo ${VERSION} | cut -d "." -f 3) - echo "PATCH=${PATCH}" >> $GITHUB_OUTPUT - - name: Increment version - id: calc_new_tag - run: | - echo "${{ steps.get_id.outputs.PATCH }}" - echo "NEW_PATCH=$(( ${{ steps.get_id.outputs.PATCH }} + 1))" >> $GITHUB_OUTPUT - echo "NEW_VERSION=$( ${{ steps.get_id.outputs.MAJOR }}.${{ steps.get_id.outputs.MINOR }}.${NEW_PATCH})" >> $GITHUB_OUTPUT - name: Create and push tag run: | - git tag -a ${{ steps.calc_new_tag.outputs.NEW_VERSION }} -m "Pushing new version ${{ steps.calc_new_tag.outputs.NEW_VERSION }}" - git push origin ${{ steps.calc_new_tag.outputs.NEW_VERSION }} + git tag -a ${{ needs.tag.outputs.new_version }} -m "Pushing new version ${{ needs.tag.outputs.new_version }}" + git push origin ${{ needs.tag.outputs.new_version }} - name: Log in to Gitea Docker Registry uses: docker/login-action@v3 with: @@ -48,10 +48,10 @@ jobs: username: hitanshu password: ${{ secrets.TOKEN }} - name: Gradle build - run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.calc_new_tag.outputs.NEW_VERSION }} + run: ./gradlew bootBuildImage --imageName=192.168.0.100:8928/hithomelabs/cftunnels:${{ needs.tag.outputs.new_version }} - name: Tag image as test - run: docker tag 192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.calc_new_tag.outputs.NEW_VERSION }} 192.168.0.100:8928/hithomelabs/cftunnels:test + run: docker tag 192.168.0.100:8928/hithomelabs/cftunnels:${{ needs.tag.outputs.new_version }} 192.168.0.100:8928/hithomelabs/cftunnels:test - name: Push to Gitea Registry run: | docker push 192.168.0.100:8928/hithomelabs/cftunnels:test - docker push 192.168.0.100:8928/hithomelabs/cftunnels:${{ steps.calc_new_tag.outputs.NEW_VERSION }} + docker push 192.168.0.100:8928/hithomelabs/cftunnels:${{ needs.tag.outputs.new_version }} From bdb4c77ac30cebb080c512359a315b509fdac48e Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 23:15:19 +0530 Subject: [PATCH 35/40] Trying to multiple jobs --- .gitea/workflows/test_image_build_push.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index dec2b35..749327a 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -9,6 +9,10 @@ jobs: outputs: new_version: ${{ steps.new_version.outputs.new_version }} steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + fetch-depth: 0 id: new_version run: | VERSION=$(git describe --tags --abbrev=0) From b7c6149fb79721db3e0b5f5cf6c935b85d3fb2e0 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 23:24:03 +0530 Subject: [PATCH 36/40] Correcting syntax --- .gitea/workflows/test_image_build_push.yml | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 749327a..26b78f7 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -9,21 +9,22 @@ jobs: outputs: new_version: ${{ steps.new_version.outputs.new_version }} steps: - - name: Check out repository code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - id: new_version - run: | - VERSION=$(git describe --tags --abbrev=0) - echo ${VERSION} - MAJOR=$(echo ${VERSION} | cut -d "." -f 1) - MINOR=$(echo ${VERSION} | cut -d "." -f 2) - PATCH=$(echo ${VERSION} | cut -d "." -f 3) - NEW_PATCH=$(( ${PATCH} + 1)) - echo ${NEW_PATCH} - echo "new_version=$($MAJOR.$MINOR.$NEW_PATCH)" >> $GITHUB_OUTPUT - echo ${new_version} + - name: Check out repository code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Get new version + id: new_version + run: | + VERSION=$(git describe --tags --abbrev=0) + echo ${VERSION} + MAJOR=$(echo ${VERSION} | cut -d "." -f 1) + MINOR=$(echo ${VERSION} | cut -d "." -f 2) + PATCH=$(echo ${VERSION} | cut -d "." -f 3) + NEW_PATCH=$(( ${PATCH} + 1)) + echo ${NEW_PATCH} + echo "new_version=$($MAJOR.$MINOR.$NEW_PATCH)" >> $GITHUB_OUTPUT + echo ${new_version} build: runs-on: ubuntu-latest needs: tag From fe591b8af09c22ffb31dd9a750ba937233057e97 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 23:32:54 +0530 Subject: [PATCH 37/40] Minor bugfix --- .gitea/workflows/test_image_build_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 26b78f7..213fa22 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -23,7 +23,7 @@ jobs: PATCH=$(echo ${VERSION} | cut -d "." -f 3) NEW_PATCH=$(( ${PATCH} + 1)) echo ${NEW_PATCH} - echo "new_version=$($MAJOR.$MINOR.$NEW_PATCH)" >> $GITHUB_OUTPUT + echo "new_version=$MAJOR.$MINOR.$NEW_PATCH" >> $GITHUB_OUTPUT echo ${new_version} build: runs-on: ubuntu-latest From 5b8735bf58f8adc0e1f109b3f6b60992d7f45c82 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 23:44:55 +0530 Subject: [PATCH 38/40] Adding git config --- .gitea/workflows/test_image_build_push.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index 213fa22..f97fdc9 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -23,7 +23,7 @@ jobs: PATCH=$(echo ${VERSION} | cut -d "." -f 3) NEW_PATCH=$(( ${PATCH} + 1)) echo ${NEW_PATCH} - echo "new_version=$MAJOR.$MINOR.$NEW_PATCH" >> $GITHUB_OUTPUT + echo "new_version=$(echo "${MAJOR}.${MINOR}.${NEW_PATCH}")" >> $GITHUB_OUTPUT echo ${new_version} build: runs-on: ubuntu-latest @@ -44,6 +44,8 @@ jobs: uses: gradle/actions/wrapper-validation@v3 - name: Create and push tag run: | + git config --global user.name "${{gitea.actor}}" + git config --global user.email "${{ gitea.actor }}@users.noreply.github.com" git tag -a ${{ needs.tag.outputs.new_version }} -m "Pushing new version ${{ needs.tag.outputs.new_version }}" git push origin ${{ needs.tag.outputs.new_version }} - name: Log in to Gitea Docker Registry From 33682a4425e8c9584f6d0b4c06e65e187a295ae6 Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 23:45:42 +0530 Subject: [PATCH 39/40] Adding git config --- .gitea/workflows/test_image_build_push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index f97fdc9..a933b76 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -44,6 +44,7 @@ jobs: uses: gradle/actions/wrapper-validation@v3 - name: Create and push tag run: | + echo "NEW_VERSION=${{ needs.tag.outputs.new_version }}" git config --global user.name "${{gitea.actor}}" git config --global user.email "${{ gitea.actor }}@users.noreply.github.com" git tag -a ${{ needs.tag.outputs.new_version }} -m "Pushing new version ${{ needs.tag.outputs.new_version }}" From 5fe2d96f42d7b6a70eeacdd5ee95b8fa83fa482b Mon Sep 17 00:00:00 2001 From: hitanshu310 Date: Tue, 10 Jun 2025 23:55:45 +0530 Subject: [PATCH 40/40] Add semantic versioning, when pushing to test PATH is incremented by 1 --- .gitea/workflows/test_image_build_push.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitea/workflows/test_image_build_push.yml b/.gitea/workflows/test_image_build_push.yml index a933b76..f53e140 100644 --- a/.gitea/workflows/test_image_build_push.yml +++ b/.gitea/workflows/test_image_build_push.yml @@ -24,8 +24,7 @@ jobs: NEW_PATCH=$(( ${PATCH} + 1)) echo ${NEW_PATCH} echo "new_version=$(echo "${MAJOR}.${MINOR}.${NEW_PATCH}")" >> $GITHUB_OUTPUT - echo ${new_version} - build: + build_tag_push: runs-on: ubuntu-latest needs: tag container: