From ceee1270e58e413aad875922652d12c229ad706a Mon Sep 17 00:00:00 2001 From: Potatoboy9999 <51728317+PotatoPresident@users.noreply.github.com> Date: Fri, 28 Jul 2023 12:02:11 -0700 Subject: [PATCH] Add build numbering --- build.gradle | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 22443cd..33f4c33 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } archivesBaseName = project.archives_base_name -version = project.mod_version +version = project.mod_version + "-" + getVersionMetadata() group = project.maven_group repositories { @@ -27,6 +27,18 @@ dependencies { modImplementation "xyz.nucleoid:plasmid:${project.plasmid_version}" } +String getVersionMetadata() { + var buildId = System.getenv("GITHUB_RUN_NUMBER") + + // CI builds only + if (buildId != null) { + return "build.$buildId" + } + + // No tracking information could be found about the build + return "snapshot" +} + processResources { inputs.property "version", project.version