-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
77 lines (70 loc) · 2.54 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
pipeline {
agent any
tools {
maven 'maven-3.9.6'
jdk 'jdk21'
}
environment {
NEXUS_VERSION = 'nexus3'
NEXUS_PROTOCOL = 'http'
NEXUS_URL = '192.168.1.16:10288'
NEXUS_REPOSITORY = 'maven-nexus-repo'
NEXUS_CREDENTIAL_ID = 'nexus-credentials'
}
stages {
stage('Gradle build') {
steps {
script {
props = readProperties file: 'gradle.properties'
// Read properties
mcVer = props['minecraft_version']
modVer = props['mod_version']
MOD_VERSION = "${mcVer}-${modVer}"
}
sh './gradlew build'
}
}
stage('Publish to Nexus') {
steps {
script {
// Fabric
nexusArtifactUploader(
nexusVersion: NEXUS_VERSION,
protocol: NEXUS_PROTOCOL,
nexusUrl: NEXUS_URL,
groupId: 'fr.fyustorm.minetiface',
version: "${MOD_VERSION}",
repository: NEXUS_REPOSITORY,
credentialsId: NEXUS_CREDENTIAL_ID,
artifacts: [
[
artifactId: 'fr.fyustorm.minetiface-fabric',
classifier: '',
file: "fabric/build/libs/minetiface-fabric_${MOD_VERSION}.jar",
type: 'jar'
],
]
)
// Forge
nexusArtifactUploader(
nexusVersion: NEXUS_VERSION,
protocol: NEXUS_PROTOCOL,
nexusUrl: NEXUS_URL,
groupId: 'fr.fyustorm.minetiface',
version: "${MOD_VERSION}",
repository: NEXUS_REPOSITORY,
credentialsId: NEXUS_CREDENTIAL_ID,
artifacts: [
[
artifactId: 'fr.fyustorm.minetiface-forge',
classifier: '',
file: "forge/build/libs/minetiface-forge_${MOD_VERSION}.jar",
type: 'jar'
],
]
)
}
}
}
}
}