Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Sep 8, 2024
1 parent 15edfc2 commit 800f8cc
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 45 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,38 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

permissions:
contents: read
packages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/[email protected]
with:
cosign-release: 'v1.13.1'
uses: sigstore/cosign-installer@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2.5.0
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2.1.0
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4.4.0
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4.0.0
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand All @@ -53,4 +51,4 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
env:
COSIGN_EXPERIMENTAL: "true"
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign -y {}@${{ steps.build-and-push.outputs.digest }}
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
alias(libs.plugins.kotlin.serialization) apply false
}
allprojects {
version = "5.3.1"
version = "5.4.0"
group = "space.votebot"

repositories {
Expand All @@ -16,7 +16,7 @@ allprojects {
subprojects {
afterEvaluate {
configure<KotlinTopLevelExtension> {
jvmToolchain(21)
jvmToolchain(22)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import io.ktor.client.statement.*
import io.ktor.http.*
import io.ktor.serialization.kotlinx.json.*
import io.ktor.utils.io.*
import java.nio.channels.ReadableByteChannel

/**
* Client for pie chart service on [url].
Expand All @@ -22,7 +21,7 @@ public class PieChartServiceClient(private val url: Url) {
/**
* Creates a PieChart for [request].
*
* @return a [ReadableByteChannel] containing the image data
* @return a [ByteReadChannel] containing the image data
*/
public suspend fun createPieChart(request: PieChartCreateRequest): ByteReadChannel = client.post(url) {
url {
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
systemProp.org.gradle.unsafe.kotlin.assignment=true
kotlin.experimental.tryK2=true
ksp.useKSP2=true
17 changes: 9 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
[versions]
kotlin = "1.9.22"
mikbot = "3.28.0"
ktor = "2.3.4"
kotlin = "2.0.20"
mikbot = "3.35.6"
ktor = "2.3.12"

[libraries]
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version = "1.6.1" }
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version = "1.7.1" }
ktor-client-okhttp = { group = "io.ktor", name = "ktor-client-okhttp", version.ref = "ktor" }
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version = "0.4.1" }
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version = "0.6.1" }

mikbot-gdpr = { group = "dev.schlaubi", name = "mikbot-gdpr" }
mikbot-health = { group = "dev.schlaubi", name = "mikbot-health" }

kordex-processor = { group = "com.kotlindiscord.kord.extensions", name = "annotation-processor", version = "1.6.0-SNAPSHOT" }
kordex-processor = { group = "com.kotlindiscord.kord.extensions", name = "annotation-processor", version = "1.9.1-mikbot-SNAPSHOT" }
java-string-similarity = { group = "info.debatty", name = "java-string-similarity", version = "2.0.0" }

[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
mikbot = { id = "dev.schlaubi.mikbot.gradle-plugin", version.ref = "mikbot" }
ksp = { id = "com.google.devtools.ksp", version = "1.9.22-1.0.16" }
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "4.1.2"}
ksp = { id = "com.google.devtools.ksp", version = "2.0.20-1.0.24" }
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "5.4.0"}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
22 changes: 12 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down Expand Up @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
11 changes: 8 additions & 3 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dev.schlaubi.mikbot.gradle.mikbot
import java.io.ByteArrayOutputStream
import java.util.Locale

plugins {
kotlin("jvm")
Expand All @@ -15,6 +16,7 @@ dependencies {
implementation(libs.java.string.similarity)
ksp(libs.kordex.processor)
optionalPlugin(mikbot(libs.mikbot.gdpr))
optionalPlugin(mikbot(libs.mikbot.health))
}

mikbotPlugin {
Expand Down Expand Up @@ -43,9 +45,12 @@ sourceSets {
}

tasks {
assembleBot {
val mikbotVersion = libs.versions.mikbot.get()
bundledPlugins.addAll("gdpr@$mikbotVersion", "database-i18n@$mikbotVersion")
// assembleBot {
// val mikbotVersion = libs.versions.mikbot.get()
//// bundledPlugins.addAll("gdpr@$mikbotVersion", "database-i18n@$mikbotVersion")
// }
generateDefaultTranslationBundle {
defaultLocale = Locale.Builder().setLanguage("en").setRegion("US").build()
}
}

Expand Down
4 changes: 2 additions & 2 deletions plugin/src/main/kotlin/space/votebot/core/VoteBotConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import io.ktor.http.*

object VoteBotConfig : EnvironmentConfig("") {
val PIE_CHART_SERVICE_URL by getEnv { Url(it) }
val GITHUB_TOKEN by environment.optional()
val GITHUB_USERNAME by environment.optional()
val GITHUB_TOKEN by getEnv().optional()
val GITHUB_USERNAME by getEnv().optional()
}

0 comments on commit 800f8cc

Please sign in to comment.