Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
287 changes: 287 additions & 0 deletions .github/workflows/auto-beta-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
name: Auto Beta Release

# Each push to the upgrade branch produces a new release tagged
# 26.1.2-beta.<N>, where N auto-increments from the highest existing tag.
# Also opens a PR back to the default branch on first push if one
# doesn't exist yet.

on:
push:
branches:
- claude/minecraft-26.1.2-upgrade-6YV9K

concurrency:
group: auto-beta-release
cancel-in-progress: false

permissions:
contents: write
pull-requests: write

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Ensure pull request exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_BRANCH: ${{ github.ref_name }}
BASE_BRANCH: ${{ github.event.repository.default_branch }}
run: |
set -euo pipefail
existing=$(gh pr list --head "${HEAD_BRANCH}" --base "${BASE_BRANCH}" --state open --json number --jq 'length')
if [ "${existing}" = "0" ]; then
gh pr create \
--base "${BASE_BRANCH}" \
--head "${HEAD_BRANCH}" \
--title "feat: add Minecraft 26.1.2 support for Spigot/Paper" \
--body "$(printf '## Summary\n- Adds bukkit-helper-26-1-2 module modeled on 1.21.11 (compiled with Java 25, requires Spigot 26.1.2-R0.1-SNAPSHOT).\n- Routes (MC: 26.*) servers to the new helper in spigot/Helper.java.\n- Wires the new module into settings.gradle and spigot/build.gradle (impl + shadowJar include).\n- ci(release): bumps to JDK 25 and adds BuildTools 26.1.2.\n- ci(auto-beta-release): on each push, computes next 26.1.2-beta.<N> tag, builds, and publishes a GitHub Release with the spigot JAR.\n\n## Test plan\n- [ ] BuildTools resolves Spigot 26.1.2-R0.1-SNAPSHOT into the local Maven repository.\n- [ ] Gradle :spigot:build succeeds on JDK 25.\n- [ ] Auto-beta-release workflow tags 26.1.2-beta.1 and uploads the spigot jar.\n- [ ] Manual smoke test on a Paper/Spigot 26.1.2 server.')" \
--draft || true
else
echo "PR already exists for ${HEAD_BRANCH} -> ${BASE_BRANCH}; skipping."
fi

- name: Compute next beta version
id: version
run: |
set -euo pipefail
BASE="26.1.2-beta"
git fetch --tags --force
LAST=$(git tag --list "${BASE}.*" \
| sed -E "s/^${BASE}\.([0-9]+)$/\1/" \
| grep -E '^[0-9]+$' \
| sort -n \
| tail -n1 || true)
if [ -z "${LAST}" ]; then
NEXT=1
else
NEXT=$((LAST + 1))
fi
TAG="${BASE}.${NEXT}"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "Next tag: ${TAG}"

- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'

- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle

- name: Download BuildTools.jar
id: download_bt
continue-on-error: true
run: |
set -uxo pipefail
mkdir -p buildtools/logs
cd buildtools
# Latest BuildTools is needed for 26.1.2.
wget -nv -O BuildTools-latest.jar \
https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar 2>&1 \
| tee logs/dl-latest.log
# Try older BuildTools build numbers that still emit the :remapped-mojang
# classifier for 1.21.x. We try a few until one downloads successfully.
for n in 196 195 194 193 192 191 190 189 188 187 186; do
url="https://hub.spigotmc.org/jenkins/job/BuildTools/$n/artifact/target/BuildTools.jar"
if wget -nv -O "BuildTools-$n.jar" "$url" 2>&1 | tee -a logs/dl-old.log; then
if [ -s "BuildTools-$n.jar" ]; then
ln -sf "BuildTools-$n.jar" BuildTools-old.jar
echo "old=$n" >> "$GITHUB_OUTPUT"
break
fi
fi
rm -f "BuildTools-$n.jar"
done
ls -la

- name: BuildTools Spigot 1.21.10 (Java 21, older BuildTools)
id: bt121_10
continue-on-error: true
working-directory: buildtools
env:
JAVA21_HOME: ${{ env.JAVA_HOME_21_X64 }}
run: |
set -uxo pipefail
mkdir -p logs
"$JAVA21_HOME/bin/java" -jar BuildTools-old.jar --rev 1.21.10 --remapped 2>&1 | tee logs/buildtools-1.21.10.log
rc=${PIPESTATUS[0]}
echo "rc=$rc" >> "$GITHUB_OUTPUT"
ls -la "$HOME/.m2/repository/org/spigotmc/spigot/1.21.10-R0.1-SNAPSHOT/" 2>&1 | tee -a logs/buildtools-1.21.10.log || true
exit 0
timeout-minutes: 30

- name: BuildTools Spigot 1.21.11 (Java 21, BuildTools latest)
id: bt121_11
continue-on-error: true
working-directory: buildtools
env:
JAVA21_HOME: ${{ env.JAVA_HOME_21_X64 }}
run: |
set -uxo pipefail
mkdir -p logs
# 1.21.11 needs toolsVersion 197+; older BuildTools refuses to build it.
"$JAVA21_HOME/bin/java" -jar BuildTools-latest.jar --rev 1.21.11 --remapped 2>&1 | tee logs/buildtools-1.21.11.log
rc=${PIPESTATUS[0]}
echo "rc=$rc" >> "$GITHUB_OUTPUT"
ls -la "$HOME/.m2/repository/org/spigotmc/spigot/1.21.11-R0.1-SNAPSHOT/" 2>&1 | tee -a logs/buildtools-1.21.11.log || true
exit 0
timeout-minutes: 30

- name: BuildTools Spigot 26.1.2 (Java 25, BuildTools latest)
id: bt2612
continue-on-error: true
working-directory: buildtools
env:
JAVA25_HOME: ${{ env.JAVA_HOME_25_X64 }}
run: |
set -uxo pipefail
mkdir -p logs
"$JAVA25_HOME/bin/java" -jar BuildTools-latest.jar --rev 26.1.2 --remapped 2>&1 | tee logs/buildtools-26.1.2.log
rc=${PIPESTATUS[0]}
{
echo "## BuildTools 26.1.2 exit=$rc"
echo
echo '```'
tail -n 80 logs/buildtools-26.1.2.log
echo '```'
echo
echo "## Maven repo for org.spigotmc"
echo '```'
ls -la "$HOME/.m2/repository/org/spigotmc/" 2>&1 || true
ls -la "$HOME/.m2/repository/org/spigotmc/spigot/" 2>&1 || true
ls -la "$HOME/.m2/repository/org/spigotmc/spigot-api/" 2>&1 || true
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
exit $rc
timeout-minutes: 45

- name: Upload BuildTools 26.1.2 log
if: always()
uses: actions/upload-artifact@v4
with:
name: buildtools-26.1.2-log
path: buildtools/logs/buildtools-26.1.2.log
if-no-files-found: ignore

- name: Build with Gradle
id: gradle_build
continue-on-error: true
env:
USERNAME: ${{ secrets.USERNAME }}
TOKEN: ${{ secrets.TOKEN }}
# Run Gradle on JDK 21 (compatible with Shadow plugin); use JDK 25 via toolchain.
JAVA_HOME: ${{ env.JAVA_HOME_21_X64 }}
run: |
set -uxo pipefail
./gradlew :spigot:build --info \
-Porg.gradle.java.installations.paths="${JAVA_HOME_25_X64},${JAVA_HOME_21_X64}" 2>&1 | tee gradle-build.log
rc=${PIPESTATUS[0]}
echo "rc=$rc" >> "$GITHUB_OUTPUT"
{
echo "## Gradle exit=$rc"
echo
echo '```'
tail -n 200 gradle-build.log
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
# Don't fail the job here so diagnostic comment can be posted.
exit 0

- name: Upload Gradle build log
if: always()
uses: actions/upload-artifact@v4
with:
name: gradle-build-log
path: gradle-build.log
if-no-files-found: ignore

- name: Post diagnostic PR comment
if: always()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -uxo pipefail
{
echo "### Diagnostic for commit ${GITHUB_SHA::7}"
echo
echo "Download BuildTools outcome: ${{ steps.download_bt.outcome }} (older build picked: ${{ steps.download_bt.outputs.old }})"
echo "BuildTools 1.21.10 outcome: ${{ steps.bt121_10.outcome }} (rc=${{ steps.bt121_10.outputs.rc }})"
echo "BuildTools 1.21.11 outcome: ${{ steps.bt121_11.outcome }} (rc=${{ steps.bt121_11.outputs.rc }})"
echo "BuildTools 26.1.2 outcome: ${{ steps.bt2612.outcome }}"
echo "Gradle outcome: ${{ steps.gradle_build.outcome }} (rc=${{ steps.gradle_build.outputs.rc }})"
echo
echo "**Maven repo (org.spigotmc):**"
echo '```'
ls -la "$HOME/.m2/repository/org/spigotmc/spigot/" 2>&1 || true
for v in 1.21.10-R0.1-SNAPSHOT 1.21.11-R0.1-SNAPSHOT 26.1.2-R0.1-SNAPSHOT; do
echo "--- spigot/$v ---"
ls -la "$HOME/.m2/repository/org/spigotmc/spigot/$v/" 2>&1 || true
done
echo '```'
echo
echo "**Download log (tail 30):**"
echo '```'
tail -n 30 buildtools/logs/dl-old.log 2>/dev/null || true
echo '```'
echo
echo "**BuildTools 1.21.10 log (tail 60):**"
echo '```'
tail -n 60 buildtools/logs/buildtools-1.21.10.log 2>/dev/null || echo "(no log)"
echo '```'
echo
echo "**BuildTools 1.21.11 log (tail 60):**"
echo '```'
tail -n 60 buildtools/logs/buildtools-1.21.11.log 2>/dev/null || echo "(no log)"
echo '```'
echo
echo "**BuildTools 26.1.2 log (tail 30):**"
echo '```'
tail -n 30 buildtools/logs/buildtools-26.1.2.log 2>/dev/null || echo "(no log)"
echo '```'
echo
echo "**Gradle log (last 200 lines):**"
echo '```'
tail -n 200 gradle-build.log 2>/dev/null || echo "(log not produced)"
echo '```'
} > pr_comment.md
PR=$(gh pr list --head "${GITHUB_REF_NAME}" --state open --json number --jq '.[0].number' || echo "")
if [ -n "$PR" ]; then
gh pr comment "$PR" --body-file pr_comment.md || true
fi
if [ "${{ steps.gradle_build.outputs.rc }}" != "0" ]; then
echo "Gradle failed; failing job."
exit 1
fi

- name: Find JAR file
id: find_jar
run: |
set -euo pipefail
JAR_FILE=$(ls target/*.jar | grep 'spigot' | tail -n 1)
echo "jar_file=${JAR_FILE}" >> "$GITHUB_OUTPUT"
echo "jar_name=$(basename "${JAR_FILE}")" >> "$GITHUB_OUTPUT"

- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.version.outputs.tag }}
JAR_FILE: ${{ steps.find_jar.outputs.jar_file }}
run: |
set -euo pipefail
gh release create "${TAG}" "${JAR_FILE}" \
--target "${GITHUB_SHA}" \
--title "${TAG}" \
--notes "Automated beta release for Minecraft 26.1.2 (commit ${GITHUB_SHA})." \
--prerelease
24 changes: 20 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,39 @@ jobs:
with:
java-version: '21'
distribution: 'temurin'

- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: '25'
distribution: 'temurin'
cache: gradle

- name: Build Spigot with BuildTools
env:
JAVA21_HOME: ${{ env.JAVA_HOME_21_X64 }}
JAVA25_HOME: ${{ env.JAVA_HOME_25_X64 }}
run: |
mkdir -p buildtools
cd buildtools
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
java -jar BuildTools.jar --rev 1.21.10 --remapped
java -jar BuildTools.jar --rev 1.21.11 --remapped
# MC 1.21.10 / 1.21.11 build with Java 21
"$JAVA21_HOME/bin/java" -jar BuildTools.jar --rev 1.21.10 --remapped
"$JAVA21_HOME/bin/java" -jar BuildTools.jar --rev 1.21.11 --remapped
# MC 26.1.2 requires Java 25
"$JAVA25_HOME/bin/java" -jar BuildTools.jar --rev 26.1.2 --remapped
cd ..
timeout-minutes: 45
timeout-minutes: 60

- name: Build with Gradle
env:
USERNAME: ${{ secrets.USERNAME }}
TOKEN: ${{ secrets.TOKEN }}
run: ./gradlew :spigot:build
# Run Gradle on JDK 21 (compatible with shadow plugin), use JDK 25 via toolchain
JAVA_HOME: ${{ env.JAVA_HOME_21_X64 }}
run: |
./gradlew :spigot:build \
-Porg.gradle.java.installations.paths="${JAVA_HOME_25_X64},${JAVA_HOME_21_X64}"

- name: Find JAR file
id: find_jar
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
buildscript {
configurations.all {
resolutionStrategy {
force("org.ow2.asm:asm:9.5")
force("org.ow2.asm:asm-commons:9.5")
force("org.ow2.asm:asm:9.8")
force("org.ow2.asm:asm-commons:9.8")
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion bukkit-helper-121-11/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ dependencies {
implementation project(':dynmap-api')
implementation project(path: ':DynmapCore', configuration: 'shadow')
compileOnly 'org.spigotmc:spigot-api:1.21.11-R0.1-SNAPSHOT'
compileOnly ('org.spigotmc:spigot:1.21.11-R0.1-SNAPSHOT:remapped-mojang') {
// BuildTools 197+ (required for 1.21.11) no longer publishes the
// :remapped-mojang classifier; the regular jar is now mojang-mapped.
compileOnly ('org.spigotmc:spigot:1.21.11-R0.1-SNAPSHOT') {
exclude group: "com.mojang", module: "jtracy"
}
}
27 changes: 27 additions & 0 deletions bukkit-helper-26-1-2/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
eclipse {
project {
name = "Dynmap(Spigot-26.1.2)"
}
}

description = 'bukkit-helper-26.1.2'

// MC 26.1+ requires Java 25.
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(25) // Need this here so eclipse task generates correctly.

java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}

dependencies {
implementation project(':bukkit-helper')
implementation project(':dynmap-api')
implementation project(path: ':DynmapCore', configuration: 'shadow')
compileOnly 'org.spigotmc:spigot-api:26.1.2-R0.1-SNAPSHOT'
// MC 26.1+ ships with mojang-mapped names by default (no `remapped-mojang` classifier needed).
compileOnly ('org.spigotmc:spigot:26.1.2-R0.1-SNAPSHOT') {
exclude group: "com.mojang", module: "jtracy"
}
}
Loading
Loading