diff --git a/1.21/.jenkins/Jenkinsfile.deploy b/1.21/.jenkins/Jenkinsfile.deploy index a70af74..6c7caa3 100644 --- a/1.21/.jenkins/Jenkinsfile.deploy +++ b/1.21/.jenkins/Jenkinsfile.deploy @@ -26,25 +26,33 @@ pipeline { } stage("Prepare") { steps { - sh "chmod +x ./gradlew" - sh "./gradlew clean" + dir("${WORKSPACE}/${majorMc}") { + sh "chmod +x ./gradlew" + sh "./gradlew clean" + } } } stage("Publish to Modrinth/Curseforge") { steps { - sh "./gradlew publishMod -Prelease=true" + dir("${WORKSPACE}/${majorMc}") { + sh "./gradlew publishMod -Prelease=true" + } } } stage("Publish to Maven") { steps { - sh "./gradlew publish -Prelease=true" + dir("${WORKSPACE}/${majorMc}") { + sh "./gradlew publish -Prelease=true" + } } } } post { always { - sh "./gradlew --stop" - deleteDir() + dir("${WORKSPACE}/${majorMc}") { + sh "./gradlew --stop" + deleteDir() + } discordSend webhookURL: env.FDD_WH_ADMIN, title: "CraterLib Port Deploy #${BUILD_NUMBER}", diff --git a/1.21/.jenkins/Jenkinsfile.snapshot b/1.21/.jenkins/Jenkinsfile.snapshot index 439755f..918f135 100644 --- a/1.21/.jenkins/Jenkinsfile.snapshot +++ b/1.21/.jenkins/Jenkinsfile.snapshot @@ -32,15 +32,19 @@ pipeline { stage("Prepare") { steps { - sh "chmod +x ./gradlew" - sh "./gradlew build -PreleaseType=${reltype}" + dir("${WORKSPACE}/${majorMc}") { + sh "chmod +x ./gradlew" + sh "./gradlew build -PreleaseType=${reltype}" + } } } stage("Publish to Maven") { steps { - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh "./gradlew publish -PreleaseType=${reltype}" + dir ("${WORKSPACE}/${majorMc}") { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh "./gradlew publish -PreleaseType=${reltype}" + } } } } @@ -48,19 +52,21 @@ pipeline { post { always { - sh "./gradlew --stop" - archiveArtifacts artifacts: 'artifacts/*.jar' + dir("${WORKSPACE}/${majorMc}") { + sh "./gradlew --stop" + archiveArtifacts artifacts: 'artifacts/*.jar' - fddsnapshotter apiKey: env.PLATFORM_KEY, - projectSlug: "craterlib", - projectName: "${projectName}", - projectIcon: "${projectIcon}", - modLoaders: "${modLoaders}", - minecraftVersions: "${supportedMc}", - failWebhook: env.SSS_WEBHOOK, - publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}" + fddsnapshotter apiKey: env.PLATFORM_KEY, + projectSlug: "craterlib", + projectName: "${projectName}", + projectIcon: "${projectIcon}", + modLoaders: "${modLoaders}", + minecraftVersions: "${supportedMc}", + failWebhook: env.SSS_WEBHOOK, + publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}" - deleteDir() + deleteDir() + } } } } diff --git a/patches/1.21/.jenkins/Jenkinsfile.deploy.patch b/patches/1.21/.jenkins/Jenkinsfile.deploy.patch new file mode 100644 index 0000000..1857ad5 --- /dev/null +++ b/patches/1.21/.jenkins/Jenkinsfile.deploy.patch @@ -0,0 +1,42 @@ +--- a/.jenkins/Jenkinsfile.deploy ++++ b/.jenkins/Jenkinsfile.deploy +@@ -26,25 +26,33 @@ + } + stage("Prepare") { + steps { +- sh "chmod +x ./gradlew" +- sh "./gradlew clean" ++ dir("${WORKSPACE}/${majorMc}") { ++ sh "chmod +x ./gradlew" ++ sh "./gradlew clean" ++ } + } + } + stage("Publish to Modrinth/Curseforge") { + steps { +- sh "./gradlew publishMod -Prelease=true" ++ dir("${WORKSPACE}/${majorMc}") { ++ sh "./gradlew publishMod -Prelease=true" ++ } + } + } + stage("Publish to Maven") { + steps { +- sh "./gradlew publish -Prelease=true" ++ dir("${WORKSPACE}/${majorMc}") { ++ sh "./gradlew publish -Prelease=true" ++ } + } + } + } + post { + always { +- sh "./gradlew --stop" +- deleteDir() ++ dir("${WORKSPACE}/${majorMc}") { ++ sh "./gradlew --stop" ++ deleteDir() ++ } + + discordSend webhookURL: env.FDD_WH_ADMIN, + title: "CraterLib Port Deploy #${BUILD_NUMBER}", diff --git a/patches/1.21/.jenkins/Jenkinsfile.snapshot.patch b/patches/1.21/.jenkins/Jenkinsfile.snapshot.patch index d4f4142..797057f 100644 --- a/patches/1.21/.jenkins/Jenkinsfile.snapshot.patch +++ b/patches/1.21/.jenkins/Jenkinsfile.snapshot.patch @@ -9,3 +9,62 @@ pipeline { agent { +@@ -32,15 +32,19 @@ + + stage("Prepare") { + steps { +- sh "chmod +x ./gradlew" +- sh "./gradlew build -PreleaseType=${reltype}" ++ dir("${WORKSPACE}/${majorMc}") { ++ sh "chmod +x ./gradlew" ++ sh "./gradlew build -PreleaseType=${reltype}" ++ } + } + } + + stage("Publish to Maven") { + steps { +- catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { +- sh "./gradlew publish -PreleaseType=${reltype}" ++ dir ("${WORKSPACE}/${majorMc}") { ++ catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { ++ sh "./gradlew publish -PreleaseType=${reltype}" ++ } + } + } + } +@@ -48,19 +52,21 @@ + + post { + always { +- sh "./gradlew --stop" +- archiveArtifacts artifacts: 'artifacts/*.jar' +- +- fddsnapshotter apiKey: env.PLATFORM_KEY, +- projectSlug: "craterlib", +- projectName: "${projectName}", +- projectIcon: "${projectIcon}", +- modLoaders: "${modLoaders}", +- minecraftVersions: "${supportedMc}", +- failWebhook: env.SSS_WEBHOOK, +- publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}" +- +- deleteDir() ++ dir("${WORKSPACE}/${majorMc}") { ++ sh "./gradlew --stop" ++ archiveArtifacts artifacts: 'artifacts/*.jar' ++ ++ fddsnapshotter apiKey: env.PLATFORM_KEY, ++ projectSlug: "craterlib", ++ projectName: "${projectName}", ++ projectIcon: "${projectIcon}", ++ modLoaders: "${modLoaders}", ++ minecraftVersions: "${supportedMc}", ++ failWebhook: env.SSS_WEBHOOK, ++ publishWebhooks: "${env.SSS_WEBHOOK}|${env.FDD_WH}" ++ ++ deleteDir() ++ } + } + } + }