diff --git a/common.gradle b/common.gradle index 03b7875..8d5f113 100644 --- a/common.gradle +++ b/common.gradle @@ -80,32 +80,33 @@ remapJar { String modVersionSuffix = '' String artifactVersion = project.mod_version +String artifactVersionSuffix = '' // detect github action environment variables // https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables if (System.getenv("BUILD_RELEASE") != "true") { String buildNumber = System.getenv("BUILD_ID") modVersionSuffix += buildNumber != null ? ('+build.' + buildNumber) : '-SNAPSHOT' - artifactVersion += '-SNAPSHOT' // A non-release artifact is always a SNAPSHOT artifact + artifactVersionSuffix = '-SNAPSHOT' // A non-release artifact is always a SNAPSHOT artifact } String finalModVersion = project.mod_version + modVersionSuffix String fullProjectVersion, fullArtifactVersion // Example version values: // project.mod_version 1.0.3 (the base mod version) -// finalModVersion 1.0.3+build.88 (the actual mod version to use) -// fullProjectVersion mc1.15.2-v1.0.3+build.88 (in build output jar name) -// fullArtifactVersion mc1.15.2-v1.0.3-SNAPSHOT (maven artifact version) +// finalModVersion 1.0.3+build.88 (the actual mod version to use in the mod) +// fullProjectVersion v1.0.3-mc1.15.2+build.88 (in build output jar name) +// fullArtifactVersion 1.0.3-mc1.15.2-SNAPSHOT (maven artifact version) group = project.maven_group if (System.getenv("JITPACK") == "true") { // move mc version into archivesBaseName, so jitpack will be able to organize archives from multiple subprojects correctly base.archivesName = project.archives_base_name + '-mc' + project.minecraft_version fullProjectVersion = 'v' + finalModVersion - fullArtifactVersion = 'v' + artifactVersion + fullArtifactVersion = artifactVersion + artifactVersionSuffix } else { base.archivesName = project.archives_base_name - fullProjectVersion = 'mc' + project.minecraft_version + '-v' + finalModVersion - fullArtifactVersion = 'mc' + project.minecraft_version + '-v' + artifactVersion + fullProjectVersion = 'v' + finalModVersion + '-mc' + project.minecraft_version + fullArtifactVersion = artifactVersion + '-mc' + project.minecraft_version + artifactVersionSuffix } version = fullProjectVersion