From 92446d5bf72522e44a7685936de3116d8a74bf99 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 20 Oct 2025 18:08:09 -0700 Subject: [PATCH 1/7] upgraded gradlew version and added publishing workflow --- .github/workflows/nightly.yaml | 59 ++++++++++++++++++++++++ build.gradle.kts | 29 ++++++++++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 84 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/nightly.yaml diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 00000000..56eba841 --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,59 @@ +name: Nightly + +on: + schedule: + # Build and publish nightly snapshot at 3:55pm every day + - cron: "55 15 * * *" + workflow_dispatch: + inputs: + pr: + description: "Pull request#" + required: false + +env: + CHC_BRANCH: "main" + +jobs: + nightly: + if: ${{ startsWith(github.repository, 'ClickHouse/') }} + name: "Build and Publish Nightly Snapshot" + runs-on: "ubuntu-latest" + timeout-minutes: 20 + steps: + - name: Check out Git repository + uses: actions/checkout@v4 +# with: +# ref: ${{ env.CHC_BRANCH }} + - name: Check out PR + run: | + git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \ + origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr + if: github.event.inputs.pr != '' + - name: Install JDK and Maven + uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: | + 17 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 + - name: Release Snapshot + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + SONATYPE_TOKEN_USER: ${{ secrets.SONATYPE_TOKEN_USER }} + SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} + run: | + ls && + gradle publishConfluentJarSnapshotToMavenLocal -Psigning.signingKey=${GPG_PRIVATE_KEY} -Psigning.password=${GPG_PASSPHRASE} +# - name: Release Snapshot +# uses: samuelmeuli/action-maven-publish@v1 +# with: +# maven_profiles: release +# maven_args: -q --batch-mode -DclickhouseVersion=${{ env.CH_VERSION }} +# server_id: central +# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} +# gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }} +# nexus_username: ${{ secrets.SONATYPE_TOKEN_USER }} +# nexus_password: ${{ secrets.SONATYPE_TOKEN }} + diff --git a/build.gradle.kts b/build.gradle.kts index 16e8b012..34d6b222 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,9 +13,9 @@ import java.time.format.DateTimeFormatter val defaultJdkVersion = 17 java { - toolchain { - languageVersion.set(JavaLanguageVersion.of(11)) - } + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } @@ -36,6 +36,7 @@ plugins { id("com.github.johnrengelman.shadow") version "7.1.2" id("com.google.protobuf") version "0.9.5" id("java-test-fixtures") + id("org.jreleaser") version "1.20.0" } group = "com.clickhouse.kafka" @@ -336,8 +337,22 @@ task("testJar", type = Jar::class) { publishing { publications { - create("mavenJava") { - from(components["java"]) // Publishes the Java component + create("confluentJarSnapshot") { + groupId = "com.clickhouse" + artifactId = "clickhouse-kafka-connector"; + version = version.toString() + "-SNAPSHOT" + + pom { + developers { + developer { + id = "clickhouse" + name = "ClickHouse" + email = "clickhouse@clickhouse.com" + } + } + } + + artifact(tasks["confluentJar"]) // Publishes the Java component } create("mavenTestJar") { artifact(tasks["testJar"]) @@ -345,3 +360,7 @@ publishing { } } + +signing { + sign(publishing.publications["confluentJarSnapshot"]) +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fce..3ae1e2f1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From b2aa2d7926f70e0a54ed8e77af1d6e34c8a145eb Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 20 Oct 2025 18:10:27 -0700 Subject: [PATCH 2/7] added temp to pr --- .github/workflows/nightly.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 56eba841..81617a3c 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -1,14 +1,11 @@ name: Nightly on: - schedule: - # Build and publish nightly snapshot at 3:55pm every day - - cron: "55 15 * * *" - workflow_dispatch: - inputs: - pr: - description: "Pull request#" - required: false + pull_request: + paths-ignore: + - '**/*.md' + - 'LICENSE' + - 'docs/**' env: CHC_BRANCH: "main" From 31c9eed18a1f7f147748d5b66aa02d9609906014 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 20 Oct 2025 18:13:22 -0700 Subject: [PATCH 3/7] use gradlew instead --- .github/workflows/nightly.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 81617a3c..2f54838b 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -32,8 +32,8 @@ jobs: distribution: "temurin" java-version: | 17 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 +# - name: Setup Gradle +# uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 - name: Release Snapshot env: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} @@ -42,7 +42,7 @@ jobs: SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} run: | ls && - gradle publishConfluentJarSnapshotToMavenLocal -Psigning.signingKey=${GPG_PRIVATE_KEY} -Psigning.password=${GPG_PASSPHRASE} + ./gradle publishConfluentJarSnapshotToMavenLocal -Psigning.signingKey=${GPG_PRIVATE_KEY} -Psigning.password=${GPG_PASSPHRASE} # - name: Release Snapshot # uses: samuelmeuli/action-maven-publish@v1 # with: From e75e54b1328e4c66cdc25c7c9450285b708ed9c2 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 20 Oct 2025 18:29:59 -0700 Subject: [PATCH 4/7] fix stupid typo --- .github/workflows/nightly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 2f54838b..ee858098 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -42,7 +42,7 @@ jobs: SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} run: | ls && - ./gradle publishConfluentJarSnapshotToMavenLocal -Psigning.signingKey=${GPG_PRIVATE_KEY} -Psigning.password=${GPG_PASSPHRASE} + ./gradlew publishConfluentJarSnapshotToMavenLocal -Psigning.signingKey=${GPG_PRIVATE_KEY} -Psigning.password=${GPG_PASSPHRASE} # - name: Release Snapshot # uses: samuelmeuli/action-maven-publish@v1 # with: From 5fdbcfb4e8b27fc0fb6bfc42bef2e2c081bc83be Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 20 Oct 2025 18:36:58 -0700 Subject: [PATCH 5/7] select using inmemory key --- .github/workflows/nightly.yaml | 2 +- build.gradle.kts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index ee858098..c249a4f5 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -42,7 +42,7 @@ jobs: SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} run: | ls && - ./gradlew publishConfluentJarSnapshotToMavenLocal -Psigning.signingKey=${GPG_PRIVATE_KEY} -Psigning.password=${GPG_PASSPHRASE} + ./gradlew publishConfluentJarSnapshotToMavenLocal -DsigningKey=${GPG_PRIVATE_KEY} -DsigningPassword=${GPG_PASSPHRASE} # - name: Release Snapshot # uses: samuelmeuli/action-maven-publish@v1 # with: diff --git a/build.gradle.kts b/build.gradle.kts index 34d6b222..4729566d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -362,5 +362,8 @@ publishing { signing { + val signingKey = properties.get("signingKey").toString() + val signingPassword = properties.get("signingPassword").toString() + useInMemoryPgpKeys(signingKey, signingPassword) sign(publishing.publications["confluentJarSnapshot"]) } \ No newline at end of file From b817d86d7b9e9f69f27831209343745ef057d2c1 Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 20 Oct 2025 18:39:38 -0700 Subject: [PATCH 6/7] select using inmemory key --- .github/workflows/nightly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index c249a4f5..6fdce801 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -42,7 +42,7 @@ jobs: SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} run: | ls && - ./gradlew publishConfluentJarSnapshotToMavenLocal -DsigningKey=${GPG_PRIVATE_KEY} -DsigningPassword=${GPG_PASSPHRASE} + ./gradlew publishConfluentJarSnapshotToMavenLocal -PsigningKey=${GPG_PRIVATE_KEY} -PsigningPassword=${GPG_PASSPHRASE} # - name: Release Snapshot # uses: samuelmeuli/action-maven-publish@v1 # with: From 60bf8987fabf80970c44fd2b672100d50b93e96d Mon Sep 17 00:00:00 2001 From: Sergey Chernov Date: Mon, 20 Oct 2025 18:42:44 -0700 Subject: [PATCH 7/7] select using inmemory key --- build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4729566d..5ef962bf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -362,8 +362,8 @@ publishing { signing { - val signingKey = properties.get("signingKey").toString() - val signingPassword = properties.get("signingPassword").toString() + val signingKey = findProperty("signingKey").toString() + val signingPassword = findProperty("signingPassword").toString() useInMemoryPgpKeys(signingKey, signingPassword) sign(publishing.publications["confluentJarSnapshot"]) } \ No newline at end of file