From 2bb1a1e1e1d7c9bdc9c156de1355bb467b3bec00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80?= Date: Sun, 26 Nov 2023 16:54:00 +0100 Subject: [PATCH] use lavalink maven repo --- .github/workflows/publish.yml | 4 +++- README.md | 5 +++-- build.gradle | 22 +++++++++++++++++++--- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 87e372a..51d01b9 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 ce6c956..99de760 100644 --- a/README.md +++ b/README.md @@ -85,10 +85,11 @@ Replace x.y.z with the latest version number lavalink: plugins: - dependency: "com.github.topi314.lavasearch:lavasearch-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 ### API diff --git a/build.gradle b/build.gradle index 1c47485..ea4e08c 100644 --- a/build.gradle +++ b/build.gradle @@ -37,6 +37,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 { if (name != "protocol") { @@ -50,9 +51,10 @@ subprojects { println "Version: " + versionStr 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" @@ -65,6 +67,20 @@ subprojects { } } } + 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") + } + } + } } } }