From 95e096aaf7beafb52a4ffee35ba1f3a7a33be8fe Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 6 Oct 2024 14:48:00 -0400 Subject: [PATCH] here we go again! --- .github/workflows/build.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0de4d7fa..bb171f2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,14 +17,16 @@ jobs: java-version: 16 distribution: adopt - - name: Get current version - id: get_version + - name: Get latest release tag + id: get_latest_tag run: | - VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - echo "Current version: $VERSION" + git fetch --tags - BASE_VERSION=${VERSION#Reborn-} + LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) + echo "Latest tag: $LATEST_TAG" + BASE_VERSION=${LATEST_TAG#vReborn-} + IFS='.' read -r -a version_parts <<< "$BASE_VERSION" LAST_INDEX=${#version_parts[@]}-1 @@ -43,16 +45,17 @@ jobs: - name: Rename JAR file run: | - JAR_FILE=$(ls target/*.jar | head -n 1) + # Find the generated JAR file + JAR_FILE=$(ls target/*.jar | head -n 1) # Get the first jar file in target echo "Found JAR file: $JAR_FILE" mv "$JAR_FILE" "SensibleToolbox v${{ env.NEW_VERSION }}.jar" - name: Create Release uses: softprops/action-gh-release@v1 with: - tag_name: "v${{ env.NEW_VERSION }}" - files: "SensibleToolbox v${{ env.NEW_VERSION }}.jar" - name: "SensibleToolbox v${{ env.NEW_VERSION }}" + tag_name: "v${{ env.NEW_VERSION }}" # Use the incremented version for the tag without extra prefix + files: "SensibleToolbox v${{ env.NEW_VERSION }}.jar" # Use the renamed file + name: "SensibleToolbox v${{ env.NEW_VERSION }}" # Naming the release body: | Release of version v${{ env.NEW_VERSION }}. env: