diff --git a/Jenkinsfile b/.jenkins/Jenkinsfile.deploy similarity index 100% rename from Jenkinsfile rename to .jenkins/Jenkinsfile.deploy diff --git a/.jenkins/Jenkinsfile.snapshot b/.jenkins/Jenkinsfile.snapshot new file mode 100644 index 0000000..c061de6 --- /dev/null +++ b/.jenkins/Jenkinsfile.snapshot @@ -0,0 +1,64 @@ +def projectName = "CraterLib"; +def projectIcon = "https://cdn.modrinth.com/data/Nn8Wasaq/a172c634683a11a2e9ae593e56eba7885743bb44.png"; + +pipeline { + agent { + label "master" + } + tools { + jdk "JAVA17" + } + + stages { + stage("Notify Discord") { + steps { + discordSend webhookURL: env.SSS_WEBHOOK, + title: "Deploy Started: ${projectName} 1.20.2 Deploy #${BUILD_NUMBER}", + link: env.BUILD_URL, + result: 'SUCCESS', + description: "Build: [${BUILD_NUMBER}](${env.BUILD_URL})" + } + } + + stage("Prepare") { + steps { + sh "chmod +x ./gradlew" + sh "./gradlew clean" + } + } + + stage("Build") { + steps { + sh "./gradlew build" + } + } + + stage("Publish to Maven") { + steps { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh "./gradlew publish" + } + } + } + } + + post { + always { + sh "./gradlew --stop" + archiveArtifacts artifacts: 'artifacts/*.jar' + + fddsnapshotter apiKey: env.PLATFORM_KEY, + projectSlug: "craterlib", + projectName: "${projectName}", + projectIcon: "${projectIcon}", + versionName: "Snapshot 3.0.${BUILD_NUMBER}", + version: "3.0.${BUILD_NUMBER}", + modLoaders: "forge|neoforge|fabric|quilt", + minecraftVersions: "1.20.2", + failWebhook: env.SSS_WEBHOOK, + publishWebhooks: env.SSS_WEBHOOK + + deleteDir() + } + } +} \ No newline at end of file