ci(release): publish versioned artifacts
CI / validate (push) Successful in 6m40s
Release / release (push) Successful in 11m55s

This commit is contained in:
dmg
2026-08-01 15:02:31 -04:00
parent 326cc60688
commit 420389d601
14 changed files with 515 additions and 5 deletions
+12 -2
View File
@@ -2,14 +2,24 @@
The plugin checks every online-mode Java login against the account-manager API. It fails closed: unavailable, unauthorized, stale, replayed, malformed, and unknown requests are denied.
## Build
## Download or build
Versioned JARs are attached to public releases at `https://git.garvis.dev/dmg/minecraft-account-manager/releases`.
To build a development JAR locally:
```bash
cd plugins/velocity
./gradlew clean test shadowJar
```
Copy `build/libs/minecraft-account-manager-velocity-0.1.0.jar` to Velocity's `plugins/` directory and start Velocity once to create `plugins/minecraft-account-manager/config.properties`.
To embed a release version in both the plugin metadata and filename:
```bash
./gradlew clean test shadowJar -PreleaseVersion=1.0.0
```
Copy `build/libs/minecraft-account-manager-velocity-VERSION.jar` to Velocity's `plugins/` directory and start Velocity once to create `plugins/minecraft-account-manager/config.properties`.
## Provision a credential
+35 -1
View File
@@ -4,7 +4,9 @@ plugins {
}
group = "games.dmg"
version = "0.1.0"
version = providers.gradleProperty("releaseVersion")
.orElse("0.1.0-SNAPSHOT")
.get()
repositories {
mavenCentral()
@@ -24,6 +26,38 @@ java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
val generatedVersionDirectory = layout.buildDirectory.dir("generated/sources/version/java/main")
val generateVersionSource = tasks.register("generateVersionSource") {
val pluginVersion = providers.provider { project.version.toString() }
inputs.property("pluginVersion", pluginVersion)
outputs.dir(generatedVersionDirectory)
doLast {
val output = generatedVersionDirectory.get()
.file("games/dmg/accountmanager/BuildMetadata.java")
.asFile
output.parentFile.mkdirs()
output.writeText(
"""package games.dmg.accountmanager;
public final class BuildMetadata {
public static final String VERSION = "${pluginVersion.get()}";
private BuildMetadata() {}
}
"""
)
}
}
sourceSets.main {
java.srcDir(generatedVersionDirectory)
}
tasks.compileJava {
dependsOn(generateVersionSource)
}
tasks.test {
useJUnitPlatform()
}
@@ -16,7 +16,7 @@ import org.slf4j.Logger;
@Plugin(
id = "minecraft-account-manager",
name = "Minecraft Account Manager",
version = "0.1.0",
version = BuildMetadata.VERSION,
description = "Fail-closed admission checks for registered Java accounts"
)
public final class MinecraftAccountManagerPlugin {