From e8c73ead9043e1b9bd4d79c5f47917735a52ce68 Mon Sep 17 00:00:00 2001 From: Teriuihi Date: Fri, 9 Aug 2024 23:04:01 +0200 Subject: [PATCH] Add Jenkinsfile for CI and update build.gradle.kts Introduce a Jenkinsfile to automate the build, archive, and notification stages in a pipeline. Additionally, modify build.gradle.kts to standardize the shadowJar output filename and remove versioning details from the filename. --- Jenkinsfile | 20 ++++++++++++++++++++ build.gradle.kts | 9 +-------- 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..4025135 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,20 @@ +pipeline { + agent any + stages { + stage('Gradle') { + steps { + sh 'bash gradlew shadowJar -x test' + } + } + stage('Archive') { + steps { + archiveArtifacts artifacts: 'build/libs/', followSymlinks: false + } + } + stage('discord') { + steps { + discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook + } + } + } +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 57eeffc..ee69bda 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,6 @@ plugins { allprojects { val build = System.getenv("BUILD_NUMBER") ?: "SNAPSHOT" group = "com.alttd.proxydiscordlink" - version = "1.0.1-BETA-$build" description = "A velocity plugin to link Discord and Minecraft accounts." apply(plugin = "java") @@ -54,14 +53,8 @@ dependencies { tasks { shadowJar { - archiveFileName.set("${project.name}-${project.version}.jar") -// exclude("net.kyori.adventure") -// exclude("net.kyori.examination") - minimize { - //exclude(dependency("net.kyori:.*:.*")) - } + archiveFileName.set("discordLink.jar") listOf( -// "net.kyori", "net.dv8tion.jda" ).forEach { relocate(it, "${rootProject.group}.lib.$it") } }