Skip to content

Commit

Permalink
Add 1000 to GitHub run number for 2022.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sergej-koscejev committed Jul 15, 2024
1 parent f329bd3 commit 7b9d562
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,21 @@ val mpsVersion = "$major.$minor" + appendOpt(bugfix, ".")
// Dependency versions
val platformVersion = "$major.$minor.+"

// We now publish only from GitHub but there are older releases from TeamCity with higher build numbers due to TeamCity
// build sequence being higher. In order for GitHub build to appear later, we bump the GitHub run number to be greater
// than the build number from TeamCity.
//
// We do it only on 2022.3 so that the hack can be eventually removed for later versions.
val githubRunNumberBump = if ("$major.$minor" == "2022.3") 1000 else 0

if (ciBuild) {
val branch = GitBasedVersioning.getGitBranch()

val buildNumber = if (System.getenv("GITHUB_RUN_NUMBER") != null)
System.getenv("GITHUB_RUN_NUMBER").toInt()
System.getenv("GITHUB_RUN_NUMBER").toInt() + githubRunNumberBump
else
System.getenv("BUILD_NUMBER")!!.toInt()

if (branch.startsWith("maintenance") || branch.startsWith("mps") || branch.startsWith("migration")) {
version = "$major.$minor.$buildNumber.${GitBasedVersioning.getGitShortCommitHash()}"
} else {
Expand Down

0 comments on commit 7b9d562

Please sign in to comment.