Skip to content

Commit

Permalink
Add build numbering
Browse files Browse the repository at this point in the history
  • Loading branch information
PotatoPresident committed Jul 28, 2023
1 parent e15177b commit ceee127
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

archivesBaseName = project.archives_base_name
version = project.mod_version
version = project.mod_version + "-" + getVersionMetadata()
group = project.maven_group

repositories {
Expand All @@ -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

Expand Down

0 comments on commit ceee127

Please sign in to comment.