-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
54 lines (47 loc) · 1.46 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pipeline {
agent any
options {
githubProjectProperty(projectUrlStr: "https://github.com/SirBlobman/CooldownsX")
}
environment {
DISCORD_URL = credentials('PUBLIC_DISCORD_WEBHOOK')
MAVEN_DEPLOY = credentials('MAVEN_DEPLOY')
}
triggers {
githubPush()
}
tools {
jdk "JDK 17"
}
stages {
stage ("Gradle: Publish") {
steps {
withGradle {
script {
sh("./gradlew --refresh-dependencies clean build")
if (env.BRANCH_NAME == "main") {
sh("./gradlew publish")
}
sh("./gradlew --stop")
}
}
}
}
}
post {
success {
archiveArtifacts artifacts: 'plugin/build/libs/CooldownsX-*.jar', fingerprint: true
}
always {
script {
discordSend webhookURL: DISCORD_URL, title: "CooldownsX", link: "${env.BUILD_URL}",
result: currentBuild.currentResult,
description: """\
**Branch:** ${env.GIT_BRANCH}
**Build:** ${env.BUILD_NUMBER}
**Status:** ${currentBuild.currentResult}""".stripIndent(),
enableArtifactsList: false, showChangeset: true
}
}
}
}