Skip to content

Commit ceee127

Browse files
Add build numbering
1 parent e15177b commit ceee127

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

build.gradle

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
archivesBaseName = project.archives_base_name
7-
version = project.mod_version
7+
version = project.mod_version + "-" + getVersionMetadata()
88
group = project.maven_group
99

1010
repositories {
@@ -27,6 +27,18 @@ dependencies {
2727
modImplementation "xyz.nucleoid:plasmid:${project.plasmid_version}"
2828
}
2929

30+
String getVersionMetadata() {
31+
var buildId = System.getenv("GITHUB_RUN_NUMBER")
32+
33+
// CI builds only
34+
if (buildId != null) {
35+
return "build.$buildId"
36+
}
37+
38+
// No tracking information could be found about the build
39+
return "snapshot"
40+
}
41+
3042
processResources {
3143
inputs.property "version", project.version
3244

0 commit comments

Comments
 (0)