forked from Glitchfiend/BiomesOPlenty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
60 lines (59 loc) · 1.65 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
55
56
57
58
59
60
@Library('forge-shared-library')_
pipeline {
options {
disableConcurrentBuilds()
}
agent {
docker {
image 'gradle:7-jdk16'
}
}
environment {
GRADLE_ARGS = '-Dorg.gradle.daemon.idletimeout=5000'
}
stages {
stage('fetch') {
steps {
checkout scm
}
}
stage('setup') {
steps {
withGradle {
sh './gradlew ${GRADLE_ARGS} --refresh-dependencies'
}
script {
env.MYVERSION = sh(returnStdout: true, script: './gradlew :properties -q | grep "^version:" | awk \'{print $2}\'').trim()
}
}
}
stage('changelog') {
when {
not {
changeRequest()
}
}
steps {
writeChangelog(currentBuild, "build/BiomesOPlenty-${env.MYVERSION}-changelog.txt")
}
}
stage('publish') {
when {
not {
changeRequest()
}
}
environment {
CURSE_API_KEY = credentials('curse-api-key')
}
steps {
withCredentials([usernamePassword(credentialsId: 'maven-adubbz-user', usernameVariable: 'MAVEN_USER', passwordVariable: 'MAVEN_PASSWORD')]) {
sh './gradlew ${GRADLE_ARGS} publish'
}
withGradle {
sh './gradlew ${GRADLE_ARGS} curseforge -PcurseApiKey=${CURSE_API_KEY}'
}
}
}
}
}