Skip to content

Commit 6cc8ec2

Browse files
committed
Add publishing parameters
1 parent 705606a commit 6cc8ec2

File tree

1 file changed

+67
-9
lines changed

1 file changed

+67
-9
lines changed

Jenkinsfile

Lines changed: 67 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,85 @@ pipeline {
66
tools {
77
jdk "jdk-17"
88
}
9+
parameters {
10+
booleanParam(
11+
name: "PUBLISH_MAVEN_RELEASE",
12+
description: "Publish release to Maven",
13+
defaultValue: false
14+
)
15+
booleanParam(
16+
name: "PUBLISH_CURSEFORGE",
17+
description: "Publish to CurseForge",
18+
defaultValue: false
19+
)
20+
booleanParam(
21+
name: "PUBLISH_MODRINTH",
22+
description: "Publish to Modrinth",
23+
defaultValue: false
24+
)
25+
booleanParam(
26+
name: "PUBLISH_GITHUB",
27+
description: "Publish to GitHub",
28+
defaultValue: false
29+
)
30+
}
931
stages {
1032
stage("Clean") {
1133
steps {
12-
echo "Cleaning Project"
1334
sh "chmod +x gradlew"
1435
sh "./gradlew clean"
1536
}
1637
}
1738
stage("Build") {
1839
steps {
19-
echo "Building"
2040
sh "./gradlew build"
2141
}
2242
}
23-
// publishing disabled for testing
24-
// stage("Publish") {
25-
// steps {
26-
// echo "Deploying to Maven"
27-
// sh "./gradlew publish"
28-
// }
29-
// }
43+
stage("Publish") {
44+
failFast false
45+
parallel {
46+
stage("Maven Release") {
47+
when {
48+
expression { return params.PUBLISH_MAVEN_RELEASE }
49+
}
50+
steps {
51+
echo "Publishing release to Maven"
52+
}
53+
}
54+
stage("Maven Snapshot") {
55+
when {
56+
expression { return !params.PUBLISH_MAVEN_RELEASE }
57+
}
58+
steps {
59+
echo "Publishing snapshot to Maven"
60+
}
61+
}
62+
stage("CurseForge") {
63+
when {
64+
expression { return params.PUBLISH_CURSEFORGE }
65+
}
66+
steps {
67+
echo "Publishing to CurseForge"
68+
}
69+
}
70+
stage("Modrinth") {
71+
when {
72+
expression { return params.PUBLISH_MODRINTH }
73+
}
74+
steps {
75+
echo "Publishing to Modrinth"
76+
}
77+
}
78+
stage("GitHub") {
79+
when {
80+
expression { return params.PUBLISH_GITHUB }
81+
}
82+
steps {
83+
echo "Publishing to GitHub"
84+
}
85+
}
86+
}
87+
}
3088
}
3189
post {
3290
always {

0 commit comments

Comments
 (0)