Skip to content

Commit

Permalink
here we go again!
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunnky committed Oct 6, 2024
1 parent 172714f commit 95e096a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 95e096a

Please sign in to comment.