Skip to content

Commit

Permalink
use lavalink maven repo
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Nov 26, 2023
1 parent 6ed2d47 commit 2bb1a1e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 19 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -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"

Expand All @@ -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")
}
}
}
}
}
}

0 comments on commit 2bb1a1e

Please sign in to comment.