From 440813f16e0b76e94d33dd0f752c6aea7e2badc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80?= Date: Sun, 26 Nov 2023 17:03:12 +0100 Subject: [PATCH] use lavalink maven repo (#146) --- .github/workflows/publish.yml | 4 +++- README.md | 5 +++-- build.gradle | 23 ++++++++++++++++++++--- plugin/build.gradle | 2 +- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9e87d187..418781a7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,8 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + LAVALINK_MAVEN_USERNAME: ${{ secrets.LAVALINK_MAVEN_USERNAME }} + LAVALINK_MAVEN_PASSWORD: ${{ secrets.LAVALINK_MAVEN_PASSWORD }} steps: - name: Checkout uses: actions/checkout@v3 @@ -26,7 +28,7 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Build and Publish - run: ./gradlew build publish --no-daemon -PMAVEN_USERNAME=$MAVEN_USERNAME -PMAVEN_PASSWORD=$MAVEN_PASSWORD + run: ./gradlew build publish --no-daemon -PMAVEN_USERNAME=$MAVEN_USERNAME -PMAVEN_PASSWORD=$MAVEN_PASSWORD -PLAVALINK_MAVEN_USERNAME=$LAVALINK_MAVEN_USERNAME -PLAVALINK_MAVEN_PASSWORD=$LAVALINK_MAVEN_PASSWORD - name: Upload main Artifact uses: actions/upload-artifact@v3 diff --git a/README.md b/README.md index b1e64204..1ca0596d 100644 --- a/README.md +++ b/README.md @@ -184,10 +184,11 @@ Replace x.y.z with the latest version number lavalink: plugins: - dependency: "com.github.topi314.lavasrc:lavasrc-plugin:x.y.z" - repository: "https://maven.topi.wtf/releases" + repository: "https://maven.lavalink.dev/releases" # this is optional for lavalink v4.0.0-beta.5 or greater + snapshot: false # set to true if you want to use snapshot builds (see below) ``` -Snapshot builds are available in https://maven.topi.wtf/snapshots with the short commit hash as the version +Snapshot builds are available in https://maven.lavalink.dev/snapshots with the short commit hash as the version ### Configuration diff --git a/build.gradle b/build.gradle index 9aa352dd..3621cb4e 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,7 @@ def getGitVersion() { } var isMavenDefined = findProperty("MAVEN_USERNAME") != null && findProperty("MAVEN_PASSWORD") != null +var isLavalinkMavenDefined = findProperty("LAVALINK_MAVEN_USERNAME") != null && findProperty("LAVALINK_MAVEN_PASSWORD") != null subprojects { apply plugin: "java" @@ -53,9 +54,10 @@ subprojects { compileJava.options.encoding = "UTF-8" publishing { - if (isMavenDefined) { - System.out.println("Publishing to Maven Repo") - repositories { + repositories { + if (isMavenDefined) { + System.out.println("Publishing to Maven Repo") + def snapshots = "https://maven.topi.wtf/snapshots" def releases = "https://maven.topi.wtf/releases" @@ -66,6 +68,21 @@ subprojects { username = findProperty("MAVEN_USERNAME") password = findProperty("MAVEN_PASSWORD") } + + } + } + if (isLavalinkMavenDefined && name == "plugin") { + System.out.println("Publishing to Lavalink Maven Repo") + def lavalinkSnapshots = "https://maven.lavalink.dev/snapshots" + def lavalinkReleases = "https://maven.lavalink.dev/releases" + + maven { + name = "Reposilite-Lavalink" + url = isSnapshot ? lavalinkSnapshots : lavalinkReleases + credentials { + username = findProperty("LAVALINK_MAVEN_USERNAME") + password = findProperty("LAVALINK_MAVEN_PASSWORD") + } } } } diff --git a/plugin/build.gradle b/plugin/build.gradle index b8c27f22..f6deca69 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -6,7 +6,7 @@ archivesBaseName = "lavasrc-plugin" lavalinkPlugin { name = "lavasrc-plugin" apiVersion = "4.0.0-beta.3" - serverVersion = "4.0.0-beta.3" + serverVersion = "4.0.0-beta.5" configurePublishing = false }