feat(ci): add drone
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
that-apex 2023-12-20 18:27:25 +01:00
parent 2c35a089ec
commit 2e1d3e6895
4 changed files with 50 additions and 13 deletions

18
.drone.yml Normal file

@ -0,0 +1,18 @@
kind: pipeline
type: docker
name: default
trigger:
event:
- push
- custom
steps:
- name: publish
pull: if-not-exists
image: openjdk:17
environment:
PACKAGESKEY:
from_secret: GITEA_PACKAGE_PUBLIC_RW
commands:
- ./gradlew --no-daemon --parallel -Pnetherite.git.packages.token=$PACKAGESKEY build publish

@ -1,6 +1,5 @@
plugins { plugins {
id "java" id "java"
id "maven-publish"
} }
java { java {
@ -21,15 +20,4 @@ publishing {
} }
} }
} }
repositories {
maven {
Map<String, String> 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/")
}
}
} }

@ -1,8 +1,9 @@
subprojects { subprojects {
apply plugin: "java" apply plugin: "java"
apply plugin: 'maven-publish'
group "lol.pyr" group "lol.pyr"
version "2.0.0" + (System.getenv().containsKey("BUILD_ID") ? "-SNAPSHOT" : "") version "2.0.0-netherite-SNAPSHOT"
java { java {
toolchain.languageVersion.set(JavaLanguageVersion.of(8)) toolchain.languageVersion.set(JavaLanguageVersion.of(8))
@ -36,4 +37,19 @@ subprojects {
url "https://jitpack.io/" 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)
}
}
}
}
} }

@ -15,6 +15,21 @@ processResources {
expand("version": version) 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 { dependencies {
compileOnly "me.clip:placeholderapi:2.11.3" // Placeholder support compileOnly "me.clip:placeholderapi:2.11.3" // Placeholder support
compileOnly "com.google.code.gson:gson:2.10.1" // JSON parsing compileOnly "com.google.code.gson:gson:2.10.1" // JSON parsing