From ae1dd25a9a6497f606ed03ad5f0df0b9f452a8c2 Mon Sep 17 00:00:00 2001 From: that-apex Date: Wed, 20 Dec 2023 18:27:25 +0100 Subject: [PATCH] feat(ci): add drone --- .drone.yml | 18 ++++++++++++++++++ api/build.gradle | 12 ------------ build.gradle | 18 +++++++++++++++++- gradlew | 0 plugin/build.gradle | 15 +++++++++++++++ 5 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 .drone.yml mode change 100644 => 100755 gradlew diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..7c6f5d3 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,18 @@ +kind: pipeline +type: docker +name: default + +trigger: + event: + - push + - custom + +steps: + - name: publish + pull: if-not-exists + image: openjdk:8-jdk + environment: + PACKAGESKEY: + from_secret: GITEA_PACKAGE_PUBLIC_RW + commands: + - ./gradlew --no-daemon --parallel -Pnetherite.git.packages.token=$PACKAGESKEY build publish diff --git a/api/build.gradle b/api/build.gradle index 349cf17..98f5894 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -1,6 +1,5 @@ plugins { id "java" - id "maven-publish" } java { @@ -21,15 +20,4 @@ publishing { } } } - repositories { - maven { - Map systemProperties = System.getenv() - credentials { - if (systemProperties.containsKey("DIST_USERNAME")) username systemProperties.get("DIST_USERNAME") - if (systemProperties.containsKey("DIST_PASSWORD")) password systemProperties.get("DIST_PASSWORD") - } - // If the BUILD_ID enviroment variable is present that means its a Jenkins build & that it should go into the snapshots repo - url = systemProperties.containsKey("BUILD_ID") ? uri("https://repo.pyr.lol/snapshots/") : uri("https://repo.pyr.lol/releases/") - } - } } \ No newline at end of file diff --git a/build.gradle b/build.gradle index e51be2b..5eff79a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,9 @@ subprojects { apply plugin: "java" + apply plugin: 'maven-publish' group "lol.pyr" - version "2.0.0" + (System.getenv().containsKey("BUILD_ID") ? "-SNAPSHOT" : "") + version "2.0.0-netherite-SNAPSHOT" java { toolchain.languageVersion.set(JavaLanguageVersion.of(8)) @@ -36,4 +37,19 @@ subprojects { url "https://jitpack.io/" } } + + publishing { + repositories { + maven { + url = uri("https://git.netherite.gg/api/packages/Netherite-Public/maven") + credentials(HttpHeaderCredentials) { + name "Authorization" + value "token ${project.properties["netherite.git.packages.token"]}" + } + authentication { + header(HttpHeaderAuthentication) + } + } + } + } } diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/plugin/build.gradle b/plugin/build.gradle index c87cb3c..6111cd6 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -15,6 +15,21 @@ processResources { expand("version": version) } +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifactId = "znpcsplus-plugin" + + pom { + name.set("znpcsplus-plugin") + description.set("The ZNPCsPlus plugin") + url.set("https://github.com/Pyrbu/ZNPCsPlus") + } + } + } +} + dependencies { compileOnly "me.clip:placeholderapi:2.11.3" // Placeholder support compileOnly "com.google.code.gson:gson:2.10.1" // JSON parsing