Add support for precise Project Zomboid versioning in builds and images. Include printGameVersion task, improve image tagging, and enhance CI/release workflows for hotfix handling.
ci / image (42, public) (push) Successful in 3m17s
ci / image (42, public) (push) Successful in 3m17s
This commit is contained in:
1 parent
c529b04ff0
commit
26ca1b90a2
9 files changed
+137
-34
No files matched your search
@@ -60,3 +60,17 @@ tasks.register<JavaExec>("patchServerJar") {
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// Used by ci/release.sh (Dockerfile stage game-version) to name the image before the full build.
|
||||
tasks.register<JavaExec>("printGameVersion") {
|
||||
description = "Prints the game version of the server jar (pz.jar)."
|
||||
group = "help"
|
||||
|
||||
val serverJar = projectZomboid.serverJar
|
||||
|
||||
classpath = sourceSets.main.get().runtimeClasspath
|
||||
mainClass = "dev.overlord.zomboidforge.patcher.GameVersionReader"
|
||||
argumentProviders.add(CommandLineArgumentProvider {
|
||||
listOf(serverJar.get().asFile.absolutePath)
|
||||
})
|
||||
}
|
||||
@@ -13,6 +13,8 @@ import org.objectweb.asm.tree.IntInsnNode;
|
||||
import org.objectweb.asm.tree.MethodInsnNode;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -32,6 +34,18 @@ public final class GameVersionReader
|
||||
|
||||
private GameVersionReader() {}
|
||||
|
||||
/** Usage: {@code GameVersionReader <server.jar>}. Prints the jar's game version, e.g. {@code 42.21.0}. */
|
||||
static void main(String[] args) throws IOException
|
||||
{
|
||||
if (args.length != 1)
|
||||
{
|
||||
System.err.println("Usage: GameVersionReader <server.jar>");
|
||||
System.exit(2);
|
||||
}
|
||||
|
||||
System.out.println(JarPatcher.readGameVersion(Path.of(args[0])));
|
||||
}
|
||||
|
||||
public static GameVersion read(byte[] coreClass)
|
||||
{
|
||||
ClassNode core = new ClassNode();
|
||||
|
||||
Reference in new issue
Block a user