Update build-and-release.yml

This commit is contained in:
THEMPGUYAlt 2025-06-20 15:14:13 -04:00 committed by GitHub
parent 7a65d4642d
commit 52f5a058e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 3 deletions

View File

@ -12,13 +12,13 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write # Required for creating releases
contents: write
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Get Java version from pom.xml or fallback to 22
- name: Get Java version from pom.xml or fallback to 21
id: java
run: |
echo "Attempting to extract Java version from pom.xml..."
@ -26,6 +26,9 @@ jobs:
if [[ -z "$version" || "$version" == *"[INFO]"* || "$version" == *"BUILD FAILURE"* ]]; then
version=$(mvn help:evaluate -Dexpression=java.version -q -DforceStdout)
fi
if [[ "$version" == "1.8" ]]; then
version="8"
fi
if [[ -z "$version" || "$version" == *"[INFO]"* || "$version" == *"BUILD FAILURE"* ]]; then
version="21"
echo "Falling back to Java version $version"
@ -48,7 +51,6 @@ jobs:
echo "version=$version" >> $GITHUB_OUTPUT
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get_version.outputs.version }}