Skip to content

Commit 83e1778

Browse files
authored
Feature/update (#14)
* update libs version
1 parent 50c66ac commit 83e1778

File tree

16 files changed

+177
-270
lines changed

16 files changed

+177
-270
lines changed

.github/workflows/detekt.yml

Lines changed: 8 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,18 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
6-
# This workflow performs a static analysis of your Kotlin source code using
7-
# Detekt.
8-
#
9-
# Scans are triggered:
10-
# 1. On every push to default and protected branches
11-
# 2. On every Pull Request targeting the default branch
12-
# 3. On a weekly schedule
13-
# 4. Manually, on demand, via the "workflow_dispatch" event
14-
#
15-
# The workflow should work with no modifications, but you might like to use a
16-
# later version of the Detekt CLI by modifing the $DETEKT_RELEASE_TAG
17-
# environment variable.
18-
name: Scan with Detekt
1+
name: Detekt
192

203
on:
21-
# Triggers the workflow on push or pull request events but only for default and protected branches
224
push:
5+
branches: [ main ]
6+
pull_request:
237
branches: [ 'feature/**' ]
24-
tags:
25-
- v[0-9]+.[0-9]+.[0-9]+
26-
278

28-
env:
29-
# Release tag associated with version of Detekt to be installed
30-
# SARIF support (required for this workflow) was introduced in Detekt v1.15.0
31-
DETEKT_RELEASE_TAG: v1.15.0
32-
33-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
349
jobs:
35-
# This workflow contains a single job called "scan"
36-
scan:
37-
name: Scan
38-
# The type of runner that the job will run on
10+
detekt:
3911
runs-on: ubuntu-latest
4012

41-
# Steps represent a sequence of tasks that will be executed as part of the job
4213
steps:
43-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
44-
- uses: actions/checkout@v3
45-
46-
# Gets the download URL associated with the $DETEKT_RELEASE_TAG
47-
- name: Get Detekt download URL
48-
id: detekt_info
49-
env:
50-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
run: |
52-
gh api graphql --field tagName=$DETEKT_RELEASE_TAG --raw-field query='
53-
query getReleaseAssetDownloadUrl($tagName: String!) {
54-
repository(name: "detekt", owner: "detekt") {
55-
release(tagName: $tagName) {
56-
releaseAssets(name: "detekt", first: 1) {
57-
nodes {
58-
downloadUrl
59-
}
60-
}
61-
tagCommit {
62-
oid
63-
}
64-
}
65-
}
66-
}
67-
' 1> gh_response.json
68-
69-
DETEKT_RELEASE_SHA=$(jq --raw-output '.data.repository.release.releaseAssets.tagCommit.oid' gh_response.json)
70-
if [ $DETEKT_RELEASE_SHA != "37f0a1d006977512f1f216506cd695039607c3e5" ]; then
71-
echo "Release tag doesn't match expected commit SHA"
72-
exit 1
73-
fi
74-
75-
DETEKT_DOWNLOAD_URL=$(jq --raw-output '.data.repository.release.releaseAssets.nodes[0].downloadUrl' gh_response.json)
76-
echo "::set-output name=download_url::$DETEKT_DOWNLOAD_URL"
77-
78-
# Sets up the detekt cli
79-
- name: Setup Detekt
80-
run: |
81-
dest=$( mktemp -d )
82-
curl --request GET \
83-
--url ${{ steps.detekt_info.outputs.download_url }} \
84-
--silent \
85-
--location \
86-
--output $dest/detekt
87-
chmod a+x $dest/detekt
88-
echo $dest >> $GITHUB_PATH
89-
90-
# Performs static analysis using Detekt
91-
- name: Run Detekt
92-
continue-on-error: true
93-
run: |
94-
detekt --input ${{ github.workspace }} --report sarif:${{ github.workspace }}/detekt.sarif.json
95-
96-
# Modifies the SARIF output produced by Detekt so that absolute URIs are relative
97-
# This is so we can easily map results onto their source files
98-
# This can be removed once relative URI support lands in Detekt: https://git.io/JLBbA
99-
- name: Make artifact location URIs relative
100-
continue-on-error: true
101-
run: |
102-
echo "$(
103-
jq \
104-
--arg github_workspace ${{ github.workspace }} \
105-
'. | ( .runs[].results[].locations[].physicalLocation.artifactLocation.uri |= if test($github_workspace) then .[($github_workspace | length | . + 1):] else . end )' \
106-
${{ github.workspace }}/detekt.sarif.json
107-
)" > ${{ github.workspace }}/detekt.sarif.json
14+
- name: "checkout"
15+
uses: actions/checkout@v4
10816

109-
# Uploads results to GitHub repository using the upload-sarif action
110-
- uses: github/codeql-action/upload-sarif@v2
111-
with:
112-
# Path to SARIF file relative to the root of the repository
113-
sarif_file: ${{ github.workspace }}/detekt.sarif.json
114-
checkout_path: ${{ github.workspace }}
17+
- name: "detekt"
18+
uses: natiginfo/action-detekt-all@1.23.5

.github/workflows/gradle.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,22 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v2
19-
- name: Set up JDK 11
20-
uses: actions/setup-java@v2
18+
uses: actions/checkout@v4
19+
- name: Set up JDK 21
20+
uses: actions/setup-java@v4
2121
with:
22-
java-version: '11'
23-
distribution: 'adopt'
22+
java-version: '21'
23+
distribution: 'temurin'
2424
cache: gradle
2525
- name: Validate Gradle wrapper
26-
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
26+
uses: gradle/wrapper-validation-action@v2
2727
- name: Build with Gradle
2828
run: ./gradlew build jacocoTestReport
2929
- name: Upload coverage to Codecov
30-
uses: codecov/codecov-action@v2
30+
uses: codecov/codecov-action@v4
3131
with:
3232
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
3333
directory: ./build/reports/jacoco
34-
# files: ./coverage1.xml,./coverage2.xml # optional
3534
flags: unittests
36-
# name: codecov-umbrella # optional
37-
# fail_ci_if_error: true # optional (default = false)
3835
verbose: true
3936

.github/workflows/maven_release.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0
2222

23-
- name: Set up JDK 11
24-
uses: actions/setup-java@v1
23+
- name: Set up JDK 21
24+
uses: actions/setup-java@v4
2525
with:
26-
java-version: '11'
27-
distribution: 'adopt'
26+
java-version: '21'
27+
distribution: 'temurin'
2828
cache: gradle
2929

3030
- name: Validate Gradle wrapper
31-
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
31+
uses: gradle/wrapper-validation-action@v2
3232

3333
- name: Print Version
3434
run: ./gradlew printVersion
@@ -37,14 +37,11 @@ jobs:
3737
run: ./gradlew build jacocoTestReport
3838

3939
- name: Upload coverage to Codecov
40-
uses: codecov/codecov-action@v2
40+
uses: codecov/codecov-action@v4
4141
with:
4242
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
4343
directory: ./build/reports/jacoco
44-
# files: ./coverage1.xml,./coverage2.xml # optional
4544
flags: unittests
46-
# name: codecov-umbrella # optional
47-
# fail_ci_if_error: true # optional (default = false)
4845
verbose: true
4946

5047
- name: Publish to Maven Central
@@ -54,3 +51,5 @@ jobs:
5451
GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
5552
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
5653
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
54+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
55+
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}

build.gradle.kts

Lines changed: 37 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12

23
group = "io.github.abaddon.kcqrs"
34

45
object Meta {
56
const val desc = "KCQRS EventStoreDB repository library"
67
const val license = "Apache-2.0"
78
const val githubRepo = "abaddon/kcqrs-EventStoreDB"
8-
const val release = "https://s01.oss.sonatype.org/service/local/"
9-
const val snapshot = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
109
const val developerName = "Stefano Longhi"
1110
const val developerOrganization = ""
1211
const val organizationUrl = "https://github.com/abaddon"
1312
}
1413

1514
object Versions {
16-
const val kcqrsCoreVersion = "0.0.7"
17-
const val kcqrsTestVersion = "0.0.3"
18-
const val eventStoreDBVersion = "3.0.1"
19-
const val slf4jVersion = "1.7.25"
20-
const val kotlinVersion = "1.6.0"
21-
const val kotlinCoroutineVersion = "1.6.0"
22-
const val jacksonModuleKotlinVersion = "2.13.3"
23-
const val testContainerVersion = "1.16.3"
24-
const val junitJupiterVersion = "5.7.0"
25-
const val jacocoToolVersion = "0.8.7"
26-
const val jvmTarget = "11"
27-
const val hopliteVersion="1.4.16"
15+
// Update these versions only if compatibility is confirmed with your library
16+
const val kcqrsCoreVersion = "0.0.10"
17+
const val kcqrsTestVersion = "0.0.11"
18+
19+
// Updated dependencies
20+
const val kurrentClientVersion = "1.0.1"
21+
const val slf4jVersion = "2.0.12"
22+
const val kotlinVersion = "2.1.21"
23+
const val kotlinCoroutineVersion = "1.10.2"
24+
const val jacksonModuleKotlinVersion = "2.16.1"
25+
const val testContainerVersion = "1.21.0"
26+
const val junitJupiterVersion = "5.10.2"
27+
const val jacocoToolVersion = "0.8.11"
28+
const val jvmTarget = "21"
29+
const val hopliteVersion = "2.7.5"
2830
}
2931

3032
plugins {
31-
kotlin("jvm") version "1.8.10"
32-
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
33-
id("com.palantir.git-version") version "2.0.0"
33+
kotlin("jvm") version "2.1.21" // Updated from 1.8.10
34+
id("io.github.gradle-nexus.publish-plugin") version "2.0.0" // Updated from 1.1.0
35+
id("com.palantir.git-version") version "3.0.0" // Updated from 2.0.0
3436
jacoco
3537
`maven-publish`
3638
signing
@@ -39,15 +41,14 @@ plugins {
3941
val versionDetails: groovy.lang.Closure<com.palantir.gradle.gitversion.VersionDetails> by extra
4042
val details = versionDetails()
4143

42-
val lastTag=details.lastTag.substring(1)
43-
val snapshotTag= {
44-
val list=lastTag.split(".")
45-
val third=(list.last().toInt() + 1).toString()
44+
val lastTag = details.lastTag.substring(1)
45+
val snapshotTag = {
46+
val list = lastTag.split(".")
47+
val third = (list.last().toInt() + 1).toString()
4648
"${list[0]}.${list[1]}.$third-SNAPSHOT"
4749
}
4850
version = if(details.isCleanTag) lastTag else snapshotTag()
4951

50-
5152
repositories {
5253
mavenCentral()
5354
mavenLocal()
@@ -57,7 +58,6 @@ repositories {
5758
snapshotsOnly()
5859
}
5960
}
60-
6161
}
6262

6363
dependencies {
@@ -76,7 +76,7 @@ dependencies {
7676
implementation("com.sksamuel.hoplite:hoplite-yaml:${Versions.hopliteVersion}")
7777

7878
//EventStoreDB
79-
implementation("com.eventstore:db-client-java:${Versions.eventStoreDBVersion}")
79+
implementation("io.kurrent:kurrentdb-client:${Versions.kurrentClientVersion}")
8080

8181
//Test
8282
testImplementation(kotlin("test"))
@@ -107,21 +107,22 @@ tasks.jacocoTestReport {
107107
}
108108

109109
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>() {
110-
kotlinOptions.jvmTarget = Versions.jvmTarget
110+
compilerOptions.jvmTarget.set(JvmTarget.fromTarget(Versions.jvmTarget))
111111
}
112112

113113
java {
114+
toolchain {
115+
languageVersion.set(JavaLanguageVersion.of(21)) // Added to explicitly set Java toolchain
116+
}
114117
withSourcesJar()
115118
withJavadocJar()
116119
}
117120

118121
signing {
119122
val signingKey = providers
120123
.environmentVariable("GPG_SIGNING_KEY")
121-
.forUseAtConfigurationTime()
122124
val signingPassphrase = providers
123125
.environmentVariable("GPG_SIGNING_PASSPHRASE")
124-
.forUseAtConfigurationTime()
125126
if (signingKey.isPresent && signingPassphrase.isPresent) {
126127
useInMemoryPgpKeys(signingKey.get(), signingPassphrase.get())
127128
val extension = extensions
@@ -148,9 +149,9 @@ publishing {
148149
}
149150
developers {
150151
developer {
151-
name.set("${Meta.developerName}")
152-
organization.set("${Meta.developerOrganization}")
153-
organizationUrl.set("${Meta.organizationUrl}")
152+
name.set(Meta.developerName)
153+
organization.set(Meta.developerOrganization)
154+
organizationUrl.set(Meta.organizationUrl)
154155
}
155156
}
156157
scm {
@@ -174,19 +175,12 @@ publishing {
174175

175176
nexusPublishing {
176177
repositories {
178+
// see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration
177179
sonatype {
178-
nexusUrl.set(uri(Meta.release))
179-
snapshotRepositoryUrl.set(uri(Meta.snapshot))
180-
val ossrhUsername = providers
181-
.environmentVariable("OSSRH_USERNAME")
182-
.forUseAtConfigurationTime()
183-
val ossrhPassword = providers
184-
.environmentVariable("OSSRH_PASSWORD")
185-
.forUseAtConfigurationTime()
186-
if (ossrhUsername.isPresent && ossrhPassword.isPresent) {
187-
username.set(ossrhUsername.get())
188-
password.set(ossrhPassword.get())
189-
}
180+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
181+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
182+
username = providers.environmentVariable("SONATYPE_USERNAME")
183+
password = providers.environmentVariable("SONATYPE_TOKEN")
190184
}
191185
}
192-
}
186+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package io.github.abaddon.kcqrs.eventstoredb.config
22

3-
import com.eventstore.dbclient.EventStoreDBClientSettings
4-
import com.eventstore.dbclient.EventStoreDBConnectionString
3+
import io.kurrent.dbclient.KurrentDBClientSettings
4+
import io.kurrent.dbclient.KurrentDBConnectionString
55

66
data class EventStoreDBConfig(
77
private val connectionString: String
88
) {
99

10-
fun eventStoreDBClientSettingsBuilder(): EventStoreDBClientSettings =
11-
EventStoreDBConnectionString
10+
fun kurrentDBClientSettingsBuilder(): KurrentDBClientSettings =
11+
KurrentDBConnectionString
1212
.parseOrThrow(connectionString)
1313

1414
}

0 commit comments

Comments
 (0)