From 5381263113b22d14c21720f5f73a1dcc8d0c2ec0 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Tue, 15 Dec 2020 14:04:06 -0500 Subject: [PATCH] Auto-Publish --- Jenkinsfile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7a4396a..aa6b356 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,7 @@ pipeline { stages { stage('Build') { steps { - sh './gradlew build javadoc publish' + sh './gradlew build javadoc' } post { success { @@ -24,5 +24,17 @@ pipeline { } } } + stage('Publish') { + when { + expression { + return sh(returnStdout: true, script: 'git tag --contains').trim().length() > 0 + } + } + steps { + withCredentials([string(credentialsId: 'curseforge_key', variable: 'CURSEFORGE_KEY')]) { + sh './gradlew -Pcurseforge.api_key="${CURSEFORGE_KEY}" curseforge publish' + } + } + } } }