diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 6dc53c3..0d42805 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 25 cache: gradle - name: Validate conventional commits @@ -35,6 +35,6 @@ jobs: - name: Upload development artifact uses: actions/upload-artifact@v3 with: - name: spigot-stealth-${{ github.sha }} + name: purpur-stealth-${{ github.sha }} path: build/libs/*.jar if-no-files-found: error diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 398ba31..78f0b2a 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 25 cache: gradle - name: Set up Node.js @@ -86,8 +86,8 @@ jobs: if: steps.release.outputs.created == 'true' uses: actions/upload-artifact@v3 with: - name: spigot-stealth-${{ steps.release.outputs.version }} - path: build/libs/spigot-stealth-${{ steps.release.outputs.version }}.jar + name: purpur-stealth-${{ steps.release.outputs.version }} + path: build/libs/purpur-stealth-${{ steps.release.outputs.version }}.jar if-no-files-found: error - name: Create Gitea release and upload plugin @@ -101,7 +101,7 @@ jobs: PREVIOUS_TAG: ${{ steps.previous_tag.outputs.value }} run: | api_url="${GITEA_SERVER_URL}/api/v1" - jar="build/libs/spigot-stealth-${VERSION}.jar" + jar="build/libs/purpur-stealth-${VERSION}.jar" export RELEASE_BODY if [ -n "$PREVIOUS_TAG" ]; then RELEASE_BODY=$(git log --pretty='format:- %s (%h)' "${PREVIOUS_TAG}..HEAD") @@ -138,4 +138,4 @@ jobs: -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/octet-stream" \ --data-binary "@${jar}" \ - "${api_url}/repos/${REPOSITORY}/releases/${release_id}/assets?name=spigot-stealth-${VERSION}.jar" + "${api_url}/repos/${REPOSITORY}/releases/${release_id}/assets?name=purpur-stealth-${VERSION}.jar" diff --git a/AGENTS.md b/AGENTS.md index a614b84..ed3f8bf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,9 +1,9 @@ -# spigot-invisibilty agent entrypoint +# purpur-stealth agent entrypoint The canonical stories, engineering guidance, and **all process documents** are in the private [SoMC OKF wiki](https://git.garvis.dev/dmg/somc-okf/src/branch/main/index.md). -Before work, read the sibling `../somc-okf/index.md`, `../somc-okf/processes/index.md`, `../somc-okf/projects/spigot-invisibilty/index.md`, `engineering.md` in that project section, and relevant `../somc-okf/user-stories/spigot-invisibilty/` stories. Also follow the parent workspace `AGENTS.md` when present. +Before work, read the sibling `../somc-okf/index.md`, `../somc-okf/processes/index.md`, `../somc-okf/projects/purpur-stealth/index.md`, `engineering.md` in that project section, and relevant `../somc-okf/user-stories/purpur-stealth/` stories. Also follow the parent workspace `AGENTS.md` when present. -For standalone checkouts, start at the [project page](https://git.garvis.dev/dmg/somc-okf/src/branch/main/projects/spigot-invisibilty/index.md) and [shared process](https://git.garvis.dev/dmg/somc-okf/src/branch/main/processes/development.md). Obtain wiki access before feature work; do not recreate a local knowledge bundle. Source builds do not require private wiki access. +For standalone checkouts, start at the [project page](https://git.garvis.dev/dmg/somc-okf/src/branch/main/projects/purpur-stealth/index.md) and [shared process](https://git.garvis.dev/dmg/somc-okf/src/branch/main/processes/development.md). Obtain wiki access before feature work; do not recreate a local knowledge bundle. Source builds do not require private wiki access. Development follows [Development cycle](https://git.garvis.dev/dmg/somc-okf/src/branch/main/runbooks/development-cycle.md): approved stories, failing tests, passing implementation, verification, then source/wiki commit and push. GitOps updates are committed locally **without pushing**; only [Do release](https://git.garvis.dev/dmg/somc-okf/src/branch/main/runbooks/do-release.md) authorizes a reviewed GitOps push. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b2d3c4b --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Purpur Stealth + +Progression-gated identity concealment for Purpur 26.2 build 2618, built and tested with Java 25. ProtocolLib 5.4.0 is required. + +## Build + +```sh +./gradlew clean check jar +``` + +Artifacts are written to `build/libs/purpur-stealth-.jar`. Gitea CI verifies pushes/pull requests; approved main-branch conventional commits drive versioned releases. The distribution tests inspect the built JAR, embedded version/runtime identity, Java 25 bytecode, and workflow naming. + +## Migration compatibility + +The repository and checkout are now `purpur-stealth` (previously remote `spigot-stealth`, local `spigot-invisibilty`). Runtime identity remains **SpigotStealth**, including `plugins/SpigotStealth/`, the existing Java entrypoint/packages, command names, `spigotstealth` permission/namespace identifiers, and persisted progression/session data. Java 17 is no longer supported for new builds or artifacts. + +Replace the old plugin JAR when installing the new distribution; never load both JARs together. Old tags and `spigot-stealth-*` release assets are preserved. Repository rename redirects have been checked against the previously deployed v1.5.0 download. Publishing a release does not authorize deployment. + +This migration does not implement the pending Eye, combat reveal, or concealed-chat stories. Existing gameplay and plugin metadata are unchanged. + +See the [canonical project](https://git.garvis.dev/dmg/somc-okf/src/branch/main/projects/purpur-stealth/index.md), [stories](https://git.garvis.dev/dmg/somc-okf/src/branch/main/user-stories/purpur-stealth/index.md), and [development cycle](https://git.garvis.dev/dmg/somc-okf/src/branch/main/runbooks/development-cycle.md). diff --git a/build.gradle.kts b/build.gradle.kts index fd82206..0df4aab 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,24 +9,25 @@ version = providers.gradleProperty("releaseVersion") repositories { mavenCentral() - maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") + maven("https://repo.purpurmc.org/snapshots/") } java { toolchain { - languageVersion = JavaLanguageVersion.of(17) + languageVersion = JavaLanguageVersion.of(25) } } tasks.withType().configureEach { - options.compilerArgs.addAll(listOf("-Xlint:all", "-Werror")) + // Retain the supported legacy Bukkit surface for runtime identity compatibility. + options.compilerArgs.addAll(listOf("-Xlint:all,-deprecation,-removal", "-Werror")) } dependencies { - compileOnly("org.spigotmc:spigot-api:26.2-R0.1-SNAPSHOT") + compileOnly("org.purpurmc.purpur:purpur-api:26.2.build.2618-stable") compileOnly("net.dmulloy2:ProtocolLib:5.4.0") - testImplementation("org.spigotmc:spigot-api:26.2-R0.1-SNAPSHOT") + testImplementation("org.purpurmc.purpur:purpur-api:26.2.build.2618-stable") testImplementation("net.dmulloy2:ProtocolLib:5.4.0") testImplementation(platform("org.junit:junit-bom:5.13.4")) testImplementation("org.junit.jupiter:junit-jupiter") @@ -37,6 +38,9 @@ dependencies { tasks.test { useJUnitPlatform() + dependsOn(tasks.jar) + systemProperty("distribution.jar", tasks.jar.get().archiveFile.get().asFile.absolutePath) + systemProperty("distribution.version", project.version.toString()) } val pluginVersion = version diff --git a/settings.gradle.kts b/settings.gradle.kts index 6efc785..a150da8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1 @@ -rootProject.name = "spigot-stealth" +rootProject.name = "purpur-stealth" diff --git a/src/test/java/games/dmg/spigotstealth/DeliveryConfigurationTest.java b/src/test/java/games/dmg/spigotstealth/DeliveryConfigurationTest.java index 396c65e..578d11e 100644 --- a/src/test/java/games/dmg/spigotstealth/DeliveryConfigurationTest.java +++ b/src/test/java/games/dmg/spigotstealth/DeliveryConfigurationTest.java @@ -13,7 +13,7 @@ class DeliveryConfigurationTest { String workflow = Files.readString(Path.of(".gitea/workflows/ci.yml")); assertTrue(workflow.contains("./gradlew clean check jar")); assertTrue(workflow.contains("commitlint")); - assertTrue(workflow.contains("spigot-stealth-${{ github.sha }}")); + assertTrue(workflow.contains("purpur-stealth-${{ github.sha }}")); } @Test @@ -21,7 +21,7 @@ class DeliveryConfigurationTest { String workflow = Files.readString(Path.of(".gitea/workflows/release.yml")); assertTrue(workflow.contains("semantic-release")); assertTrue(workflow.contains("-PreleaseVersion=\"$VERSION\"")); - assertTrue(workflow.contains("spigot-stealth-${VERSION}.jar")); + assertTrue(workflow.contains("purpur-stealth-${VERSION}.jar")); assertTrue(workflow.contains("/releases/${release_id}/assets")); } } diff --git a/src/test/java/games/dmg/spigotstealth/PurpurDistributionTest.java b/src/test/java/games/dmg/spigotstealth/PurpurDistributionTest.java new file mode 100644 index 0000000..0ffff7a --- /dev/null +++ b/src/test/java/games/dmg/spigotstealth/PurpurDistributionTest.java @@ -0,0 +1,53 @@ +package games.dmg.spigotstealth; + +import static org.junit.jupiter.api.Assertions.*; + +import java.io.DataInputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Map; +import java.util.jar.JarFile; +import org.junit.jupiter.api.Test; +import org.yaml.snakeyaml.Yaml; + +class PurpurDistributionTest { + @Test + void packagesNewNameWithoutChangingRuntimeIdentityOrBundlingTheApi() throws Exception { + Path artifact = Path.of(System.getProperty("distribution.jar")); + String version = System.getProperty("distribution.version"); + assertEquals("purpur-stealth-" + version + ".jar", artifact.getFileName().toString()); + try (var jar = new JarFile(artifact.toFile())) { + Map metadata = new Yaml().load(jar.getInputStream(jar.getJarEntry("plugin.yml"))); + assertEquals(version, metadata.get("version")); + assertEquals("SpigotStealth", metadata.get("name"), "Retain the data directory and persistent namespace"); + assertEquals("games.dmg.spigotstealth.SpigotStealthPlugin", metadata.get("main")); + assertTrue(((Map) metadata.get("permissions")).containsKey("spigotstealth.admin")); + assertFalse(jar.stream().anyMatch(entry -> entry.getName().startsWith("org/bukkit/") + || entry.getName().startsWith("org/purpurmc/") || entry.getName().endsWith("Test.class"))); + } + } + + @Test + void pluginBytecodeTargetsJava25() throws Exception { + try (var jar = new JarFile(System.getProperty("distribution.jar")); + var bytecode = new DataInputStream(jar.getInputStream( + jar.getJarEntry("games/dmg/spigotstealth/SpigotStealthPlugin.class")))) { + assertEquals(0xCAFEBABE, bytecode.readInt()); + bytecode.readUnsignedShort(); + assertEquals(69, bytecode.readUnsignedShort()); + } + } + + @Test + void releaseAndCiAgreeWithThePurpurDistributionNameAndToolchain() throws Exception { + String build = Files.readString(Path.of("build.gradle.kts")); + assertTrue(build.contains("purpur-api:26.2.build.2618-stable")); + assertFalse(build.contains("org.spigotmc:spigot-api")); + for (String workflow : new String[] {"ci.yml", "release.yml"}) { + String content = Files.readString(Path.of(".gitea/workflows", workflow)); + assertTrue(content.contains("java-version: 25")); + assertTrue(content.contains("purpur-stealth-"), workflow); + assertFalse(content.contains("spigot-stealth-"), workflow); + } + } +}