Skip to content

Commit

Permalink
Fixed mixing artifact version and mod version
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed May 23, 2024
1 parent b3eb080 commit 37b8e8c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,25 @@ remapJar {
remapperIsolation = true
}

String versionSuffix = ''
String modVersionSuffix = '', 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")
versionSuffix += buildNumber != null ? ('+build.' + buildNumber) : '-SNAPSHOT'
modVersionSuffix += buildNumber != null ? ('+build.' + buildNumber) : '-SNAPSHOT'
artifactVersionSuffix += '-SNAPSHOT' // A non-release artifact is always a SNAPSHOT artifact
}
String fullModVersion = project.mod_version + versionSuffix
String fullModVersion = project.mod_version + modVersionSuffix
String fullArtifactVersion = project.mod_version + artifactVersionSuffix

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
version = 'v' + fullModVersion
version = 'v' + fullArtifactVersion
} else {
base.archivesName = project.archives_base_name
version = 'mc' + project.minecraft_version + '-v' + fullModVersion
version = 'mc' + project.minecraft_version + '-v' + fullArtifactVersion
}

// See https://youtrack.jetbrains.com/issue/IDEA-296490
Expand Down

0 comments on commit 37b8e8c

Please sign in to comment.