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