mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2025-12-23 16:59:18 +00:00
Fix Publishing to the Downloads API (#499)
* Update build process * Ensure BUILD_JSON env is init * Fallback to GH run number * Use tmp file for metadata.json Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> --------- Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
This commit is contained in:
@@ -49,7 +49,7 @@ fun Project.versionWithBranchName(): String =
|
||||
branchName().replace(Regex("[^0-9A-Za-z-_]"), "-") + '-' + version
|
||||
|
||||
fun buildNumber(): Int =
|
||||
(System.getenv("GITHUB_RUN_NUMBER") ?: jenkinsBuildNumber())?.let { Integer.parseInt(it) } ?: -1
|
||||
(System.getenv("BUILD_NUMBER"))?.let { Integer.parseInt(it) } ?: -1
|
||||
|
||||
fun buildNumberAsString(): String =
|
||||
buildNumber().takeIf { it != -1 }?.toString() ?: "??"
|
||||
@@ -81,5 +81,4 @@ private fun calcExclusion(section: String, bit: Int, excludedOn: Int): String =
|
||||
if (excludedOn and bit > 0) section else ""
|
||||
|
||||
// todo remove these when we're not using Jenkins anymore
|
||||
private fun jenkinsBranchName(): String? = System.getenv("BRANCH_NAME")
|
||||
private fun jenkinsBuildNumber(): String? = System.getenv("BUILD_NUMBER")
|
||||
private fun jenkinsBranchName(): String? = System.getenv("BRANCH_NAME")
|
||||
Reference in New Issue
Block a user