From 1efde8470484a0bd5fb6e03db167dc759e070eb7 Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Fri, 20 Jun 2025 15:04:41 -0400 Subject: [PATCH 01/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f7bd033..350c27e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Limbo [![Build Status](http://ci.loohpjames.com/job/Limbo/badge/icon)](http://ci.loohpjames.com/job/Limbo/) +If the webserver is down, then the actions work fine ## Standalone Limbo Minecraft Server (Currently 1.21.6) https://www.spigotmc.org/resources/82468/ From 08c7c775a3abe4b419ab0458d20674923eafe161 Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Fri, 20 Jun 2025 15:07:41 -0400 Subject: [PATCH 02/11] Create build-and-release.yml --- .github/workflows/build-and-release.yml | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/build-and-release.yml diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml new file mode 100644 index 0000000..6f2cb73 --- /dev/null +++ b/.github/workflows/build-and-release.yml @@ -0,0 +1,47 @@ +name: Build and Release JAR + +on: + push: + branches: + - '**' + paths-ignore: + - 'README.md' + +jobs: + build-and-release: + runs-on: ubuntu-latest + + permissions: + contents: write # Required for creating releases + + steps: + - name: Checkout source code + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Build with Maven + run: mvn package -DskipTests + + - name: Get version from pom.xml + id: get_version + run: | + version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + 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 }} + name: Release v${{ steps.get_version.outputs.version }} + generate_release_notes: true + + - name: Upload JAR to release + uses: softprops/action-gh-release@v2 + with: + files: target/*.jar From 7a65d4642dea7d4da67ad9670ed686b7cf9d218a Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Fri, 20 Jun 2025 15:11:15 -0400 Subject: [PATCH 03/11] Update build-and-release.yml --- .github/workflows/build-and-release.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 6f2cb73..d21ba2f 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -18,10 +18,24 @@ jobs: - name: Checkout source code uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Get Java version from pom.xml or fallback to 22 + id: java + run: | + echo "Attempting to extract Java version from pom.xml..." + version=$(mvn help:evaluate -Dexpression=maven.compiler.source -q -DforceStdout) + if [[ -z "$version" || "$version" == *"[INFO]"* || "$version" == *"BUILD FAILURE"* ]]; then + version=$(mvn help:evaluate -Dexpression=java.version -q -DforceStdout) + fi + if [[ -z "$version" || "$version" == *"[INFO]"* || "$version" == *"BUILD FAILURE"* ]]; then + version="21" + echo "Falling back to Java version $version" + fi + echo "java=$version" >> $GITHUB_OUTPUT + + - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: '17' + java-version: ${{ steps.java.outputs.java }} distribution: 'temurin' - name: Build with Maven From 52f5a058e8b2310db164768303a2e82278703a38 Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Fri, 20 Jun 2025 15:14:13 -0400 Subject: [PATCH 04/11] Update build-and-release.yml --- .github/workflows/build-and-release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index d21ba2f..f344d91 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -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 }} From a21517c1501c7977dfbadba82bccdfd3dfd17e81 Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Fri, 20 Jun 2025 15:23:06 -0400 Subject: [PATCH 05/11] Update build-and-release.yml --- .github/workflows/build-and-release.yml | 71 +++++++++++++++++-------- 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index f344d91..ec44da4 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -12,52 +12,79 @@ jobs: runs-on: ubuntu-latest permissions: - contents: write + contents: write # Required for tagging and release steps: - - name: Checkout source code + # 1. Checkout your code + - name: Checkout your repo uses: actions/checkout@v4 + # 2. Detect Java version or fallback to 21 - name: Get Java version from pom.xml or fallback to 21 id: java run: | - echo "Attempting to extract Java version from pom.xml..." - version=$(mvn help:evaluate -Dexpression=maven.compiler.source -q -DforceStdout) - 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" + version=$(mvn help:evaluate -Dexpression=maven.compiler.source -q -DforceStdout || echo "") + if [[ -z "$version" ]]; then + version=$(mvn help:evaluate -Dexpression=java.version -q -DforceStdout || echo "") fi + if [[ "$version" == "1.8" ]]; then version="8"; fi + if [[ -z "$version" ]]; then version="21"; fi echo "java=$version" >> $GITHUB_OUTPUT + # 3. Setup JDK - name: Set up JDK uses: actions/setup-java@v4 with: java-version: ${{ steps.java.outputs.java }} distribution: 'temurin' - - name: Build with Maven + # 4. Clone and build ViaLimbo + - name: Clone and build ViaLimbo + run: | + mkdir -p external + git clone https://github.com/LOOHP/ViaLimbo.git external/ViaLimbo + cd external/ViaLimbo + mvn package -DskipTests + cd ../../ + + # 5. Clone and build Floodgate-Limbo + - name: Clone and build Floodgate-Limbo + run: | + git clone https://github.com/LOOHP/floodgate-limbo.git external/floodgate-limbo + cd external/floodgate-limbo + mvn package -DskipTests + cd ../../ + + # 6. Build your project + - name: Build your project run: mvn package -DskipTests - - name: Get version from pom.xml + # 7. Get your project version from pom.xml + - name: Get project version id: get_version run: | version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) echo "version=$version" >> $GITHUB_OUTPUT + # 8. Create Git tag if it doesn't exist + - name: Create Git Tag + run: | + tag="v${{ steps.get_version.outputs.version }}" + if ! git rev-parse "$tag" >/dev/null 2>&1; then + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git tag "$tag" + git push origin "$tag" + fi + + # 9. Create GitHub Release and upload JARs - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: - tag_name: v${{ steps.get_version.outputs.version }} - name: Release v${{ steps.get_version.outputs.version }} + tag_name: "v${{ steps.get_version.outputs.version }}" + name: "Release v${{ steps.get_version.outputs.version }}" generate_release_notes: true - - - name: Upload JAR to release - uses: softprops/action-gh-release@v2 - with: - files: target/*.jar + files: | + target/*.jar + external/ViaLimbo/target/*.jar + external/floodgate-limbo/target/*.jar From 28c00827fc3e8aa028c0315df764a7cc0be51940 Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Wed, 25 Jun 2025 15:14:48 -0400 Subject: [PATCH 06/11] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 350c27e..92d7e77 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Limbo -[![Build Status](http://ci.loohpjames.com/job/Limbo/badge/icon)](http://ci.loohpjames.com/job/Limbo/) -If the webserver is down, then the actions work fine +[![Main Limbo Build Status] (http://ci.loohpjames.com/job/Limbo/badge/icon)](http://ci.loohpjames.com/job/Limbo/) [![Limbo Builds Status](https://github.com/THEMPGUYAlt/LimboBuilds/actions/workflows/build-and-release.yml/badge.svg)](https://github.com/THEMPGUYAlt/LimboBuilds/actions/workflows/build-and-release.yml) +If the main limbo webserver is down then this one prob has a archive of the builds ## Standalone Limbo Minecraft Server (Currently 1.21.6) https://www.spigotmc.org/resources/82468/ From 085ae526e06facaab12a979c7ac519c40e514181 Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Wed, 25 Jun 2025 15:15:34 -0400 Subject: [PATCH 07/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 92d7e77..9a61080 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Limbo -[![Main Limbo Build Status] (http://ci.loohpjames.com/job/Limbo/badge/icon)](http://ci.loohpjames.com/job/Limbo/) [![Limbo Builds Status](https://github.com/THEMPGUYAlt/LimboBuilds/actions/workflows/build-and-release.yml/badge.svg)](https://github.com/THEMPGUYAlt/LimboBuilds/actions/workflows/build-and-release.yml) +[![Main Limbo Build Status](http://ci.loohpjames.com/job/Limbo/badge/icon)](http://ci.loohpjames.com/job/Limbo/) [![Limbo Builds Status](https://github.com/THEMPGUYAlt/LimboBuilds/actions/workflows/build-and-release.yml/badge.svg)](https://github.com/THEMPGUYAlt/LimboBuilds/actions/workflows/build-and-release.yml) If the main limbo webserver is down then this one prob has a archive of the builds ## Standalone Limbo Minecraft Server (Currently 1.21.6) From c755000b98b0cb5e5841819c77c8a4df62a27317 Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Wed, 25 Jun 2025 15:21:44 -0400 Subject: [PATCH 08/11] Update build-and-release.yml --- .github/workflows/build-and-release.yml | 133 +++++++++++++----------- 1 file changed, 73 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index ec44da4..2524b63 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -1,90 +1,103 @@ -name: Build and Release JAR +name: Build Limbo and Add-ons on: push: branches: - - '**' + - main paths-ignore: - - 'README.md' + - '**/README.md' + - '**/readme.md' + workflow_dispatch: jobs: - build-and-release: + build: runs-on: ubuntu-latest - - permissions: - contents: write # Required for tagging and release + defaults: + run: + shell: bash steps: - # 1. Checkout your code - - name: Checkout your repo + - name: Checkout repository uses: actions/checkout@v4 - # 2. Detect Java version or fallback to 21 - - name: Get Java version from pom.xml or fallback to 21 + - name: Set up default JDK (21 fallback) id: java - run: | - version=$(mvn help:evaluate -Dexpression=maven.compiler.source -q -DforceStdout || echo "") - if [[ -z "$version" ]]; then - version=$(mvn help:evaluate -Dexpression=java.version -q -DforceStdout || echo "") - fi - if [[ "$version" == "1.8" ]]; then version="8"; fi - if [[ -z "$version" ]]; then version="21"; fi - echo "java=$version" >> $GITHUB_OUTPUT - - # 3. Setup JDK - - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: ${{ steps.java.outputs.java }} - distribution: 'temurin' + distribution: temurin + java-version: 21 - # 4. Clone and build ViaLimbo - - name: Clone and build ViaLimbo + - name: Install `javap` dependencies + run: sudo apt-get update && sudo apt-get install -y openjdk-21-jdk + + - name: Function to detect class version + id: detect-java run: | - mkdir -p external + find_external_class_version() { + class_file=$(find "$1" -name "*.class" | head -n 1) + if [[ -f "$class_file" ]]; then + version=$(javap -verbose "$class_file" | grep "major version" | awk '{print $3}') + echo "Detected major version: $version" + + # Map to Java version + if [[ "$version" == "61" ]]; then + echo "Detected Java 17" + echo "java_version=17" >> "$GITHUB_OUTPUT" + elif [[ "$version" == "65" ]]; then + echo "Detected Java 21" + echo "java_version=21" >> "$GITHUB_OUTPUT" + else + echo "Unknown version. Falling back to 21" + echo "java_version=21" >> "$GITHUB_OUTPUT" + fi + else + echo "No .class file found, defaulting to JDK 21" + echo "java_version=21" >> "$GITHUB_OUTPUT" + fi + } + + # Clone and check ViaLimbo first git clone https://github.com/LOOHP/ViaLimbo.git external/ViaLimbo + mvn -f external/ViaLimbo/pom.xml dependency:resolve || true + + # Try detecting version + find_external_class_version "external/ViaLimbo" + continue-on-error: true + + - name: Set up detected JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ steps.detect-java.outputs.java_version }} + + - name: Build ViaLimbo (optional) + run: | cd external/ViaLimbo - mvn package -DskipTests - cd ../../ + mvn package -DskipTests || echo "::warning::ViaLimbo build failed" + continue-on-error: true - # 5. Clone and build Floodgate-Limbo - - name: Clone and build Floodgate-Limbo + - name: Build FloodgateLimbo (optional) run: | - git clone https://github.com/LOOHP/floodgate-limbo.git external/floodgate-limbo - cd external/floodgate-limbo - mvn package -DskipTests - cd ../../ + git clone https://github.com/LOOHP/floodgate-limbo.git external/FloodgateLimbo + cd external/FloodgateLimbo + mvn package -DskipTests || echo "::warning::FloodgateLimbo build failed" + continue-on-error: true - # 6. Build your project - - name: Build your project - run: mvn package -DskipTests + - name: Set up Java for main project (from pom.xml or fallback) + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 - # 7. Get your project version from pom.xml - - name: Get project version - id: get_version - run: | - version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - echo "version=$version" >> $GITHUB_OUTPUT + - name: Build your main project + run: mvn package -DskipTests || echo "::warning::Main project build failed" + continue-on-error: true - # 8. Create Git tag if it doesn't exist - - name: Create Git Tag - run: | - tag="v${{ steps.get_version.outputs.version }}" - if ! git rev-parse "$tag" >/dev/null 2>&1; then - git config user.name "github-actions" - git config user.email "github-actions@github.com" - git tag "$tag" - git push origin "$tag" - fi - - # 9. Create GitHub Release and upload JARs - name: Create GitHub Release + if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 with: - tag_name: "v${{ steps.get_version.outputs.version }}" - name: "Release v${{ steps.get_version.outputs.version }}" - generate_release_notes: true files: | target/*.jar external/ViaLimbo/target/*.jar - external/floodgate-limbo/target/*.jar + external/FloodgateLimbo/target/*.jar From 50ece6e665686cc98812af2ca3fd22707e1d6899 Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Wed, 25 Jun 2025 15:35:15 -0400 Subject: [PATCH 09/11] Update build-and-release.yml --- .github/workflows/build-and-release.yml | 99 ++++++++++++++----------- 1 file changed, 56 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 2524b63..5d34618 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -1,4 +1,4 @@ -name: Build Limbo and Add-ons +name: Build Limbo Project and Add-ons on: push: @@ -17,83 +17,96 @@ jobs: shell: bash steps: - - name: Checkout repository + - name: Checkout source uses: actions/checkout@v4 - - name: Set up default JDK (21 fallback) - id: java + - name: Set up fallback JDK 21 uses: actions/setup-java@v4 with: distribution: temurin java-version: 21 - - name: Install `javap` dependencies + - name: Install javap tools run: sudo apt-get update && sudo apt-get install -y openjdk-21-jdk - - name: Function to detect class version + - name: Create Maven settings (skip checksum validation) + run: | + mkdir -p .mvn + cat > .mvn/settings.xml < + + + central + Maven Central + https://repo.maven.apache.org/maven2 + central + + + + + no-checksums + + + + no-checksums + + + EOF + + - name: Clone ViaLimbo + run: git clone https://github.com/LOOHP/ViaLimbo.git external/ViaLimbo + + - name: Resolve ViaLimbo dependencies + run: mvn -f external/ViaLimbo/pom.xml dependency:resolve -s .mvn/settings.xml || true + + - name: Detect Java version from class id: detect-java run: | - find_external_class_version() { - class_file=$(find "$1" -name "*.class" | head -n 1) - if [[ -f "$class_file" ]]; then - version=$(javap -verbose "$class_file" | grep "major version" | awk '{print $3}') - echo "Detected major version: $version" - - # Map to Java version - if [[ "$version" == "61" ]]; then - echo "Detected Java 17" - echo "java_version=17" >> "$GITHUB_OUTPUT" - elif [[ "$version" == "65" ]]; then - echo "Detected Java 21" - echo "java_version=21" >> "$GITHUB_OUTPUT" - else - echo "Unknown version. Falling back to 21" - echo "java_version=21" >> "$GITHUB_OUTPUT" - fi + CLASS_FILE=$(find external/ViaLimbo -name "*.class" | head -n 1) + if [[ -f "$CLASS_FILE" ]]; then + MAJOR=$(javap -verbose "$CLASS_FILE" | grep "major version" | awk '{print $3}') + echo "Detected major version: $MAJOR" + if [[ "$MAJOR" -eq 61 ]]; then + echo "java_version=17" >> $GITHUB_OUTPUT + elif [[ "$MAJOR" -eq 65 ]]; then + echo "java_version=21" >> $GITHUB_OUTPUT else - echo "No .class file found, defaulting to JDK 21" - echo "java_version=21" >> "$GITHUB_OUTPUT" + echo "java_version=21" >> $GITHUB_OUTPUT fi - } + else + echo "java_version=21" >> $GITHUB_OUTPUT + fi - # Clone and check ViaLimbo first - git clone https://github.com/LOOHP/ViaLimbo.git external/ViaLimbo - mvn -f external/ViaLimbo/pom.xml dependency:resolve || true - - # Try detecting version - find_external_class_version "external/ViaLimbo" - continue-on-error: true - - - name: Set up detected JDK + - name: Setup Java for ViaLimbo uses: actions/setup-java@v4 with: distribution: temurin java-version: ${{ steps.detect-java.outputs.java_version }} - - name: Build ViaLimbo (optional) + - name: Build ViaLimbo run: | cd external/ViaLimbo - mvn package -DskipTests || echo "::warning::ViaLimbo build failed" + mvn package -DskipTests -s ../../.mvn/settings.xml || echo "::warning::ViaLimbo build failed" continue-on-error: true - - name: Build FloodgateLimbo (optional) + - name: Clone and Build Floodgate-Limbo run: | git clone https://github.com/LOOHP/floodgate-limbo.git external/FloodgateLimbo cd external/FloodgateLimbo - mvn package -DskipTests || echo "::warning::FloodgateLimbo build failed" + mvn package -DskipTests -s ../../.mvn/settings.xml || echo "::warning::FloodgateLimbo build failed" continue-on-error: true - - name: Set up Java for main project (from pom.xml or fallback) + - name: Set up JDK 21 for main project uses: actions/setup-java@v4 with: distribution: temurin java-version: 21 - - name: Build your main project - run: mvn package -DskipTests || echo "::warning::Main project build failed" + - name: Build Main Project + run: mvn package -DskipTests -s .mvn/settings.xml || echo "::warning::Main project build failed" continue-on-error: true - - name: Create GitHub Release + - name: Create GitHub Release (if tagged) if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 with: From 287acb6885fb0e027a21d9a64d3105a73a42c6bd Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Wed, 25 Jun 2025 15:41:52 -0400 Subject: [PATCH 10/11] Update build-and-release.yml --- .github/workflows/build-and-release.yml | 82 ++++++++++--------------- 1 file changed, 32 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 5d34618..698ed1e 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -12,12 +12,9 @@ on: jobs: build: runs-on: ubuntu-latest - defaults: - run: - shell: bash steps: - - name: Checkout source + - name: Checkout code uses: actions/checkout@v4 - name: Set up fallback JDK 21 @@ -26,22 +23,14 @@ jobs: distribution: temurin java-version: 21 - - name: Install javap tools - run: sudo apt-get update && sudo apt-get install -y openjdk-21-jdk + - name: Install tools + run: sudo apt-get update && sudo apt-get install -y openjdk-21-jdk unzip - name: Create Maven settings (skip checksum validation) run: | mkdir -p .mvn cat > .mvn/settings.xml < - - - central - Maven Central - https://repo.maven.apache.org/maven2 - central - - no-checksums @@ -53,64 +42,57 @@ jobs: EOF + # ---------- Build Addons ---------- - name: Clone ViaLimbo run: git clone https://github.com/LOOHP/ViaLimbo.git external/ViaLimbo - - name: Resolve ViaLimbo dependencies - run: mvn -f external/ViaLimbo/pom.xml dependency:resolve -s .mvn/settings.xml || true - - - name: Detect Java version from class - id: detect-java - run: | - CLASS_FILE=$(find external/ViaLimbo -name "*.class" | head -n 1) - if [[ -f "$CLASS_FILE" ]]; then - MAJOR=$(javap -verbose "$CLASS_FILE" | grep "major version" | awk '{print $3}') - echo "Detected major version: $MAJOR" - if [[ "$MAJOR" -eq 61 ]]; then - echo "java_version=17" >> $GITHUB_OUTPUT - elif [[ "$MAJOR" -eq 65 ]]; then - echo "java_version=21" >> $GITHUB_OUTPUT - else - echo "java_version=21" >> $GITHUB_OUTPUT - fi - else - echo "java_version=21" >> $GITHUB_OUTPUT - fi - - - name: Setup Java for ViaLimbo - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: ${{ steps.detect-java.outputs.java_version }} - - name: Build ViaLimbo run: | cd external/ViaLimbo mvn package -DskipTests -s ../../.mvn/settings.xml || echo "::warning::ViaLimbo build failed" continue-on-error: true - - name: Clone and Build Floodgate-Limbo + - name: Clone and Build FloodgateLimbo run: | git clone https://github.com/LOOHP/floodgate-limbo.git external/FloodgateLimbo cd external/FloodgateLimbo mvn package -DskipTests -s ../../.mvn/settings.xml || echo "::warning::FloodgateLimbo build failed" continue-on-error: true - - name: Set up JDK 21 for main project - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 - + # ---------- Build Main Project ---------- - name: Build Main Project run: mvn package -DskipTests -s .mvn/settings.xml || echo "::warning::Main project build failed" continue-on-error: true - - name: Create GitHub Release (if tagged) - if: startsWith(github.ref, 'refs/tags/') + # ---------- Detect Version ---------- + - name: Detect Minecraft version from JAR name + id: detect-version + run: | + FILE=$(find target -name "*.jar" | head -n 1) + echo "Found JAR: $FILE" + VERSION=$(echo "$FILE" | grep -oP '\d+\.\d+\.\d+') + echo "Detected version: $VERSION" + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "tag=release-$VERSION" >> $GITHUB_OUTPUT + + # ---------- Create Git Tag ---------- + - name: Auto-tag commit + if: github.ref == 'refs/heads/main' + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git tag ${{ steps.detect-version.outputs.tag }} + git push origin ${{ steps.detect-version.outputs.tag }} + + # ---------- Create GitHub Release ---------- + - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: + tag_name: ${{ steps.detect-version.outputs.tag }} + name: Limbo Build ${{ steps.detect-version.outputs.version }} files: | target/*.jar external/ViaLimbo/target/*.jar external/FloodgateLimbo/target/*.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8b3cc47fe42017328cf4e9dd8e2e38c948ca380c Mon Sep 17 00:00:00 2001 From: THEMPGUYAlt Date: Wed, 25 Jun 2025 15:56:15 -0400 Subject: [PATCH 11/11] Update build-and-release.yml --- .github/workflows/build-and-release.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 698ed1e..1d1ff34 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -70,10 +70,11 @@ jobs: run: | FILE=$(find target -name "*.jar" | head -n 1) echo "Found JAR: $FILE" - VERSION=$(echo "$FILE" | grep -oP '\d+\.\d+\.\d+') - echo "Detected version: $VERSION" - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "tag=release-$VERSION" >> $GITHUB_OUTPUT + VERSION=$(echo "$FILE" | grep -oP '\d+\.\d+\.\d+' | head -n 1) + TAG_NAME="release-${VERSION//./-}" + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT" + # ---------- Create Git Tag ---------- - name: Auto-tag commit @@ -90,6 +91,7 @@ jobs: with: tag_name: ${{ steps.detect-version.outputs.tag }} name: Limbo Build ${{ steps.detect-version.outputs.version }} + files: | target/*.jar external/ViaLimbo/target/*.jar