HexCasting/Jenkinsfile

56 lines
1.5 KiB
Plaintext
Raw Normal View History

2022-04-04 22:01:07 +02:00
#!/usr/bin/env groovy
pipeline {
agent any
tools {
jdk "jdk-17.0.1"
}
environment {
2022-04-04 22:09:20 +02:00
discordWebhook = credentials('discordWebhook')
2023-04-24 18:19:51 +02:00
CURSEFORGE_TOKEN = credentials('curseforgeApiKey')
MODRINTH_TOKEN = credentials('modrinthApiKey')
2022-04-04 22:01:07 +02:00
}
stages {
stage('Clean') {
steps {
echo 'Cleaning Project'
sh 'chmod +x gradlew'
sh './gradlew clean'
}
}
stage('Build') {
steps {
echo 'Building'
2022-05-23 21:21:13 +02:00
sh './gradlew build'
2022-04-04 22:01:07 +02:00
}
}
stage('Publish') {
2023-04-24 18:19:51 +02:00
when {
anyOf {
branch 'main'
}
}
stages {
stage('Deploy Previews') {
steps {
echo 'Deploying previews to various places'
sh './gradlew publish publishToDiscord'
}
}
stage('Deploy releases') {
steps {
echo 'Maybe deploy releases'
sh './gradlew publishCurseforge publishModrinth'
}
}
2022-04-04 22:01:07 +02:00
}
}
}
post {
always {
2022-05-23 21:21:13 +02:00
archiveArtifacts 'Common/build/libs/**.jar'
2022-05-21 23:11:38 +02:00
archiveArtifacts 'Forge/build/libs/**.jar'
archiveArtifacts 'Fabric/build/libs/**.jar'
2022-04-04 22:01:07 +02:00
}
}
}