From 19d7eb650bfbb28c3667d8f5ff0b3ef220e8bca2 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 15 Jul 2025 18:29:01 -0700 Subject: [PATCH 1/5] Add servers list validation --- .github/workflows/validate.yml | 34 +++++++++++++++++++++++++++++++ .github/workflows/xmllint.yml | 14 ------------- Servers.xsd | 37 ++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/validate.yml delete mode 100644 .github/workflows/xmllint.yml create mode 100644 Servers.xsd diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..d1e9e17 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,34 @@ +name: Validate Servers + +on: [push, pull_request] + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get -y install libxml2-utils + + - name: Validate against XSD schema + run: | + if ! xmllint --noout --schema Servers.xsd Servers.xml 2>&1 | tee validation_output.txt; then + # Parse xmllint output and create annotations + while IFS= read -r line; do + if [[ $line == *"Servers.xml:"* ]]; then + # Extract line number and error message + if [[ $line =~ Servers\.xml:([0-9]+): ]]; then + line_num="${BASH_REMATCH[1]}" + error_msg=$(echo "$line" | sed 's/.*: //') + echo "::error file=Servers.xml,line=${line_num}::${error_msg}" + fi + fi + done < validation_output.txt + echo "::error file=Servers.xml::XSD validation failed" + exit 1 + fi + echo "XSD validation passed" + echo "::endgroup::" diff --git a/.github/workflows/xmllint.yml b/.github/workflows/xmllint.yml deleted file mode 100644 index 361cf4e..0000000 --- a/.github/workflows/xmllint.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: xmllint - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install xmllint - run: sudo apt-get -y install libxml2-utils - - name: Check that Servers.xml at least parses cleanly - run: | - xmllint Servers.xml diff --git a/Servers.xsd b/Servers.xsd new file mode 100644 index 0000000..533edc8 --- /dev/null +++ b/Servers.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From e090f384e659a94e4afb1c9facf3b7d778a9e28e Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 15 Jul 2025 18:34:18 -0700 Subject: [PATCH 2/5] Update validate.yml --- .github/workflows/validate.yml | 41 ++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index d1e9e17..035842d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -15,20 +15,33 @@ jobs: - name: Validate against XSD schema run: | - if ! xmllint --noout --schema Servers.xsd Servers.xml 2>&1 | tee validation_output.txt; then - # Parse xmllint output and create annotations - while IFS= read -r line; do - if [[ $line == *"Servers.xml:"* ]]; then - # Extract line number and error message - if [[ $line =~ Servers\.xml:([0-9]+): ]]; then - line_num="${BASH_REMATCH[1]}" - error_msg=$(echo "$line" | sed 's/.*: //') - echo "::error file=Servers.xml,line=${line_num}::${error_msg}" + echo "::group::XSD Schema Validation" + + # Run validation and capture output + if xmllint --noout --schema Servers.xsd Servers.xml 2>&1 | tee validation_output.txt; then + # Check if there were any validation errors in the output + if grep -q "Schemas validity error\|fails to validate" validation_output.txt; then + echo "Validation errors found, creating annotations..." + # Parse xmllint output and create annotations + while IFS= read -r line; do + if [[ $line == *"Servers.xml:"* && $line == *"Schemas validity error"* ]]; then + # Extract line number and error message + if [[ $line =~ Servers\.xml:([0-9]+): ]]; then + line_num="${BASH_REMATCH[1]}" + error_msg=$(echo "$line" | sed 's/.*Schemas validity error : //') + echo "::error file=Servers.xml,line=${line_num}::${error_msg}" + fi fi - fi - done < validation_output.txt - echo "::error file=Servers.xml::XSD validation failed" + done < validation_output.txt + echo "::error file=Servers.xml::XSD validation failed - see annotations above" + echo "::endgroup::" + exit 1 + else + echo "XSD validation passed" + echo "::endgroup::" + fi + else + echo "::error file=Servers.xml::XML parsing failed" + echo "::endgroup::" exit 1 fi - echo "XSD validation passed" - echo "::endgroup::" From 949fc882b1b7067d00aa8fe1fb535037c87b246e Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 15 Jul 2025 18:36:55 -0700 Subject: [PATCH 3/5] Set all non-specific servers to Stable status --- Servers.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Servers.xml b/Servers.xml index 48387e5..c230688 100644 --- a/Servers.xml +++ b/Servers.xml @@ -56,7 +56,7 @@ df.drunkenfell.com 9000 PvE - + Stable http://www.drunkenfell.com https://discord.gg/e365fBcuaB @@ -80,7 +80,7 @@ serafino.ddns.net 9060 PvE - + Stable https://discord.gg/GHKk4ck @@ -92,7 +92,7 @@ serafino.ddns.net 9070 PvP - + Stable https://discord.gg/GHKk4ck @@ -104,7 +104,7 @@ levistras.acportalstorm.com 9000 PvE - + Stable https://discord.gg/TtkcWbv @@ -212,7 +212,7 @@ asheronscall.hopto.org 9000 PvE - + Stable https://discord.gg/VSFtYXN3v7 @@ -464,7 +464,7 @@ ebontide.zapto.org 9000 PvP - + Stable https://discord.gg/r4b9yeNY From 776723abbd799fd1b4bf99fc320f7c1214ae1149 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 15 Jul 2025 18:37:51 -0700 Subject: [PATCH 4/5] Change all PVE to PvE --- Servers.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Servers.xml b/Servers.xml index c230688..cd674cf 100644 --- a/Servers.xml +++ b/Servers.xml @@ -127,7 +127,7 @@ ACE thistlecrown.ddns.net 9000 - PVE + PvE Stable https://discord.gg/uhZ3hn7 @@ -199,7 +199,7 @@ ACE www.asheron4fun.com 9050 - PVE + PvE Stable https://web.asheron4fun.com/ https://discord.gg/afnQNXj @@ -247,7 +247,7 @@ ACE morgentau.online 9000 - PVE + PvE Development https://forum.morgentau.online/ https://discord.gg/gJCYTr5fPU From d8783298cc8e16575ed86c0a5073fd6ffef1e9c2 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 15 Jul 2025 18:39:05 -0700 Subject: [PATCH 5/5] Rename validate workflow --- .github/workflows/{validate.yml => ci.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{validate.yml => ci.yml} (98%) diff --git a/.github/workflows/validate.yml b/.github/workflows/ci.yml similarity index 98% rename from .github/workflows/validate.yml rename to .github/workflows/ci.yml index 035842d..d84a51a 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Validate Servers +name: CI on: [push, pull_request] @@ -16,7 +16,7 @@ jobs: - name: Validate against XSD schema run: | echo "::group::XSD Schema Validation" - + # Run validation and capture output if xmllint --noout --schema Servers.xsd Servers.xml 2>&1 | tee validation_output.txt; then # Check if there were any validation errors in the output