ci(release): publish versioned artifacts
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user