From f8881deb669246b85ca64c1cb0e31f45d61762a8 Mon Sep 17 00:00:00 2001 From: Jannik Reimers Date: Thu, 3 Apr 2025 16:13:21 +0200 Subject: [PATCH] lets hope this works --- .github/workflows/root.yml | 25 ++++++++++++++++++++++++- Dockerfile | 10 +++++----- build.gradle.kts | 4 +++- gradle/libs.versions.toml | 6 ++++++ settings.gradle.kts | 2 +- 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml index 9346b75..15d6659 100644 --- a/.github/workflows/root.yml +++ b/.github/workflows/root.yml @@ -16,7 +16,7 @@ jobs: uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: temurin - name: Gradle (Setup) @@ -41,3 +41,26 @@ jobs: with: name: JARs path: build/libs/*.jar + + - name: Login to DigitalOcean Registry + uses: docker/login-action@v3 + + with: + registry: registry.digitalocean.com + username: ${{ secrets.DOMAIL }} + password: ${{ secrets.DOKEY }} + + - name: Build the Docker image + run: docker build -t registry.digitalocean.com/jansel/feixiao:latest -t registry.digitalocean.com/jansel/feixiao:${{ steps.date.outputs.date }} . + + - name: Push the Docker image related to this workflow + run: docker push registry.digitalocean.com/jansel/feixiao:${{ steps.date.outputs.date }} + + - name: Push the latest Docker image + run: docker push registry.digitalocean.com/jansel/feixiao:latest + + - name: Remove the Docker image + run: docker rmi registry.digitalocean.com/jansel/feixiao:${{ steps.date.outputs.date }} + + - name: Force remove the latest Docker image + run: docker rmi registry.digitalocean.com/jansel/feixiao:latest --force diff --git a/Dockerfile b/Dockerfile index a1de03e..aba8390 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,17 +13,17 @@ VOLUME [ "/bot/data" ] VOLUME [ "/bot/plugins" ] # Copy the distribution files into the container -COPY [ "build/distributions/template-1.0-SNAPSHOT.tar", "/dist" ] +COPY [ "build/distributions/aglaea-7.2.7.tar", "/dist" ] # Extract the distribution files, and prepare them for use -RUN tar -xf /dist/template-1.0-SNAPSHOT.tar -C /dist/out -RUN chmod +x /dist/out/template-1.0-SNAPSHOT/bin/template +RUN tar -xf /dist/aglaea-7.2.7.tar -C /dist/out +RUN chmod +x /dist/out/aglaea-7.2.7/bin/aglaea # Clean up unnecessary files -RUN rm /dist/template-1.0-SNAPSHOT.tar +RUN rm /dist/aglaea-7.2.7.tar # Set the correct working directory WORKDIR /bot # Run the distribution start script -ENTRYPOINT [ "/dist/out/template-1.0-SNAPSHOT/bin/template" ] +ENTRYPOINT [ "/dist/out/aglaea-7.2.7/bin/aglaea" ] diff --git a/build.gradle.kts b/build.gradle.kts index 00d2bd8..f1864c4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,13 +14,15 @@ plugins { } group = "dev.jansel.aglaea" -version = "1.0-SNAPSHOT" +version = "7.2.7" dependencies { detektPlugins(libs.detekt) implementation(libs.kotlin.stdlib) implementation(libs.kx.ser) + implementation(libs.twitch4j) + implementation(libs.events4j) // Logging dependencies implementation(libs.groovy) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 203a826..79f1c0d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,6 +10,9 @@ logback-groovy = "1.14.5" logging = "7.0.3" kordex-gradle = "1.7.0" kordex = "2.3.1-SNAPSHOT" +twitch4j = "1.24.0" +events4j = "0.12.2" + [libraries] detekt = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } @@ -20,6 +23,9 @@ kx-ser = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version. logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } logback-groovy = { module = "io.github.virtualdogbert:logback-groovy-config", version.ref = "logback-groovy" } logging = { module = "io.github.oshai:kotlin-logging", version.ref = "logging" } +twitch4j = { module = "com.github.twitch4j:twitch4j", version.ref = "twitch4j" } +events4j = { module = "com.github.philippheuer.events4j:events4j-handler-reactor", version.ref = "events4j" } + [plugins] detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 01a346d..12f1ef9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,4 +8,4 @@ pluginManagement { } } -rootProject.name = "template" +rootProject.name = "aglaea"