Skip to content

Commit 4e2f7e4

Browse files
committed
Add initial Jenkinsfile, append build number to version if present
1 parent 98a2027 commit 4e2f7e4

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

Jenkinsfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env groovy
2+
// noinspection GroovyAssignabilityCheck
3+
4+
pipeline {
5+
agent any
6+
tools {
7+
jdk "jdk-17"
8+
}
9+
stages {
10+
stage("Clean") {
11+
steps {
12+
echo "Cleaning Project"
13+
sh "chmod +x gradlew"
14+
sh "./gradlew clean"
15+
}
16+
}
17+
stage("Build") {
18+
steps {
19+
echo "Building"
20+
sh "./gradlew build"
21+
}
22+
}
23+
// publishing disabled for testing
24+
// stage("Publish") {
25+
// steps {
26+
// echo "Deploying to Maven"
27+
// sh "./gradlew publish"
28+
// }
29+
// }
30+
}
31+
post {
32+
always {
33+
archiveArtifacts "Common/build/libs/hexdebug*.jar"
34+
archiveArtifacts "Fabric/build/libs/hexdebug*.jar"
35+
archiveArtifacts "Forge/build/libs/hexdebug*.jar"
36+
}
37+
}
38+
}

plugins/src/main/kotlin/hexdebug/conventions/kotlin.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ repositories {
4343
hexdebugProperties.also {
4444
group = it.mavenGroup
4545
version = "${it.modVersion}+${it.minecraftVersion}"
46+
System.getenv("BUILD_NUMBER")?.let { build ->
47+
version = "$version-pre-$build"
48+
}
4649
}
4750

4851
java {

0 commit comments

Comments
 (0)