Skip to content

Commit fd82d9b

Browse files
authored
Merge branch 'dev' into update-udpqueue
2 parents b4a439d + bc9dcb2 commit fd82d9b

File tree

10 files changed

+55
-73
lines changed

10 files changed

+55
-73
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ name: Build
22

33
on:
44
push:
5-
paths-ignore:
6-
- '**.md'
5+
branches: [ '**' ]
6+
paths-ignore: [ '**.md' ]
7+
workflow_call:
8+
secrets:
9+
DOCKERHUB_USERNAME:
10+
DOCKERHUB_TOKEN:
711

812
jobs:
9-
gradle:
13+
build:
1014
runs-on: ubuntu-latest
11-
outputs:
12-
rundocker: ${{ steps.rundocker.outputs.rundocker }}
15+
env:
16+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
17+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
1318
steps:
1419
- name: Checkout
1520
uses: actions/checkout@v3
@@ -33,29 +38,8 @@ jobs:
3338
name: Lavalink.jar
3439
path: LavalinkServer/build/libs/Lavalink.jar
3540

36-
- name: Check Docker Build
37-
id: rundocker
38-
env:
39-
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
40-
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
41-
run: |
42-
echo "Run docker build: ${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
43-
echo "::set-output name=rundocker::${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
44-
45-
docker:
46-
needs: gradle
47-
runs-on: ubuntu-latest
48-
if: needs.gradle.outputs.rundocker == 'true'
49-
steps:
50-
- name: Checkout
51-
uses: actions/checkout@v2
52-
53-
- name: Download Artifacts
54-
uses: actions/download-artifact@v2
55-
with:
56-
name: Lavalink.jar
57-
5841
- name: Docker Meta
42+
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
5943
id: meta
6044
uses: docker/metadata-action@v4
6145
with:
@@ -68,18 +52,22 @@ jobs:
6852
type=sha,prefix=
6953
7054
- name: Set up QEMU
55+
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
7156
uses: docker/setup-qemu-action@v2
7257

7358
- name: Set up Docker Buildx
59+
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
7460
uses: docker/setup-buildx-action@v2
7561

7662
- name: Login to DockerHub
63+
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
7764
uses: docker/login-action@v2
7865
with:
79-
username: ${{ secrets.DOCKERHUB_USERNAME }}
80-
password: ${{ secrets.DOCKERHUB_TOKEN }}
66+
username: ${{ env.DOCKERHUB_USERNAME }}
67+
password: ${{ env.DOCKERHUB_TOKEN }}
8168

82-
- name: Build and push
69+
- name: Build and Push
70+
if: env.DOCKERHUB_USERNAME && env.DOCKERHUB_TOKEN
8371
uses: docker/build-push-action@v3
8472
with:
8573
file: LavalinkServer/docker/Dockerfile
@@ -88,23 +76,3 @@ jobs:
8876
push: true
8977
tags: ${{ steps.meta.outputs.tags }}
9078
labels: ${{ steps.meta.outputs.labels }}
91-
92-
release:
93-
needs: gradle
94-
permissions:
95-
contents: write
96-
runs-on: ubuntu-latest
97-
if: startsWith(github.ref, 'refs/tags/')
98-
steps:
99-
- name: Checkout
100-
uses: actions/checkout@v2
101-
102-
- name: Download Artifacts
103-
uses: actions/download-artifact@v2
104-
with:
105-
name: Lavalink.jar
106-
107-
- name: Upload Artifacts to GitHub Release
108-
uses: softprops/action-gh-release@v1
109-
with:
110-
files: Lavalink.jar

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
uses: ./.github/workflows/build.yml
10+
secrets:
11+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
12+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
13+
14+
release:
15+
needs: build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Download Artifacts
22+
uses: actions/download-artifact@v2
23+
with:
24+
name: Lavalink.jar
25+
26+
- name: Upload Artifacts to GitHub Release
27+
uses: softprops/action-gh-release@v1
28+
with:
29+
files: Lavalink.jar

LavalinkServer/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
/debug_token
77
build/*
88
/out/
9-
VERSION.txt

LavalinkServer/build.gradle.kts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,10 @@ tasks {
7474
}
7575

7676
processResources {
77-
val buildNumber = if (System.getenv("CI") != null) {
78-
System.getenv("BUILD_NUMBER") ?: "Unknown"
79-
} else {
80-
"Unofficial"
81-
}
82-
8377
val tokens = mapOf(
8478
"project.version" to project.version,
8579
"project.groupId" to project.group,
8680
"project.artifactId" to "Lavalink-Server",
87-
"env.BUILD_NUMBER" to buildNumber,
8881
"env.BUILD_TIME" to System.currentTimeMillis().toString()
8982
)
9083

@@ -137,11 +130,3 @@ fun versionFromTag(): String = Grgit.open(mapOf("currentDir" to project.rootDir)
137130

138131
return if (headTag != null && clean) headTag.name else "${git.head().id}-SNAPSHOT"
139132
}
140-
141-
//create a simple version file that we will be reading to create appropriate docker tags
142-
fun versionTxt() {
143-
val versionTxt = File("$projectDir/VERSION.txt")
144-
versionTxt.writeText("${project.version}\n")
145-
}
146-
147-
versionTxt()

LavalinkServer/docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ RUN chown -R lavalink:lavalink /opt/Lavalink
1010

1111
USER lavalink
1212

13-
COPY Lavalink.jar Lavalink.jar
13+
COPY LavalinkServer/build/libs/Lavalink.jar Lavalink.jar
1414

1515
ENTRYPOINT ["java", "-Djdk.tls.client.protocols=TLSv1.1,TLSv1.2", "-Xmx4G", "-jar", "Lavalink.jar"]

LavalinkServer/src/main/java/lavalink/server/Launcher.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ object Launcher {
6969
val commitTime = dtf.format(Instant.ofEpochMilli(gitRepoState.commitTime * 1000))
7070

7171
val version = appInfo.version.takeUnless { it.startsWith("@") } ?: "Unknown"
72-
val buildNumber = appInfo.buildNumber.takeUnless { it.startsWith("@") } ?: "Unofficial"
7372

7473
return buildString {
7574
if (vanity) {
@@ -83,7 +82,6 @@ object Launcher {
8382
}
8483
appendln()
8584
append("${indentation}Version: "); appendln(version)
86-
append("${indentation}Build: "); appendln(buildNumber)
8785
if (gitRepoState.isLoaded) {
8886
append("${indentation}Build time: "); appendln(buildTime)
8987
append("${indentation}Branch "); appendln(gitRepoState.branch)

LavalinkServer/src/main/java/lavalink/server/config/KoeConfiguration.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ class KoeConfiguration(val serverConfig: ServerConfig) {
4646
bufferSize, UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION)
4747
bufferSize = UdpQueueFramePollerFactory.DEFAULT_BUFFER_DURATION
4848
}
49-
setFramePollerFactory(UdpQueueFramePollerFactory(bufferSize, Runtime.getRuntime().availableProcessors()))
49+
try {
50+
setFramePollerFactory(UdpQueueFramePollerFactory(bufferSize, Runtime.getRuntime().availableProcessors()))
51+
} catch (e: Throwable) {
52+
log.warn("Failed to enable JDA-NAS! GC pauses may cause your bot to stutter during playback.", e)
53+
}
5054
} else {
5155
log.warn("This system and architecture appears to not support native audio sending! "
5256
+ "GC pauses may cause your bot to stutter during playback.")
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
22
33
4-
buildNumber[email protected]_NUMBER@
54
buildTime[email protected]_TIME@

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Any client libraries marked with `Unmaintained` have been marked as such as thei
119119
however they are listed as they may still support Lavalink, and/or have not needed maintenance, however keep in mind that compatibility and full feature support is not guaranteed.
120120

121121
## Server configuration
122-
Download binaries from [the CI server](https://ci.fredboat.com/viewLog.html?buildId=lastSuccessful&buildTypeId=Lavalink_Build&tab=artifacts&guest=1) or [the GitHub releases](https://github.com/freyacodes/Lavalink/releases).
122+
Download binaries from [the GitHub actions](https://github.com/freyacodes/Lavalink/actions) or [the GitHub releases](https://github.com/freyacodes/Lavalink/releases)(specific versions prior to `v3.5` can be found in the [CI Server](https://ci.fredboat.com/viewLog.html?buildId=lastSuccessful&buildTypeId=Lavalink_Build&tab=artifacts&guest=1)).
123123

124124
Put an `application.yml` file in your working directory. ([Example here](https://github.com/freyacodes/Lavalink/blob/master/LavalinkServer/application.yml.example))
125125

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fun VersionCatalogBuilder.spring() {
3636
}
3737

3838
fun VersionCatalogBuilder.voice() {
39-
version("lavaplayer", "1.3.98.3")
39+
version("lavaplayer", "1.3.98.4")
4040

4141
library("lavaplayer", "com.github.walkyst.lavaplayer-fork", "lavaplayer").versionRef("lavaplayer")
4242
library("lavaplayer-ip-rotator", "com.github.walkyst.lavaplayer-fork", "lavaplayer-ext-youtube-rotator").versionRef("lavaplayer")

0 commit comments

Comments
 (0)