Skip to content

Commit

Permalink
use lavalink maven repo (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 authored Nov 26, 2023
1 parent 9473def commit 440813f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 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 @@ -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

Expand Down
23 changes: 20 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"

Expand All @@ -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")
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 440813f

Please sign in to comment.