Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/release-connector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
jobs:
release:
name: Build and Publish ClickHouse Flink Connector
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
if: env.SKIP_STEP != 'true'
- name: Set up JDK 17
if: env.SKIP_STEP != 'true'
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
architecture: x64
- name: Build shadowJar
if: env.SKIP_STEP != 'true'
uses: gradle/gradle-build-action@v2
with:
arguments: shadowJar shadowSourcesJar
- name: Deploy ClickHouse Flink Connector
if: env.SKIP_STEP != 'true'
uses: gradle/gradle-build-action@v2
env:
NMCP_USERNAME: ${{ secrets.NMCP_USERNAME }}
NMCP_PASSWORD: ${{ secrets.NMCP_PASSWORD }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
with:
arguments: publishMavenPublicationToCentralPortal
75 changes: 71 additions & 4 deletions flink-connector-clickhouse-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ plugins {
`maven-publish`
scala
java
signing
id("com.gradleup.nmcp") version "0.0.8"
id("com.github.johnrengelman.shadow") version "8.1.1"
}

Expand All @@ -15,7 +17,7 @@ val sinkVersion = "0.0.1"

repositories {
// Use Maven Central for resolving dependencies.
// mavenLocal()
// mavenLocal()
maven("https://s01.oss.sonatype.org/content/groups/staging/") // Temporary until we have a Java Client release
mavenCentral()
}
Expand Down Expand Up @@ -142,18 +144,83 @@ tasks.shadowJar {
mergeServiceFiles()
}

val shadowSourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("all-sources")
from(sourceSets.main.get().allSource)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

tasks.jar {
enabled = false
}

publishing {
publications {
create<MavenPublication>("maven") {
//from(components["java"])
artifact(tasks.shadowJar)
groupId = "org.apache.flink.connector"
artifactId = "clickhouse"
groupId = "com.clickhouse.flink"
artifactId = "flink-connector-clickhouse"
version = sinkVersion

artifact(shadowSourcesJar)

pom {
name.set("ClickHouse Flink Connector")
description.set("Official Apache Flink connector for ClickHouse")
url.set("https://github.com/ClickHouse/flink-connector-clickhouse")

licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://github.com/ClickHouse/flink-connector-clickhouse/blob/main/LICENSE")
}
}

developers {
developer {
id.set("mzitnik")
name.set("Mark Zitnik")
email.set("[email protected]")
}
developer {
id.set("BentsiLeviav")
name.set("Bentsi Leviav")
email.set("[email protected]")
}
}

scm {
connection.set("[email protected]:ClickHouse/flink-connector-clickhouse.git")
url.set("https://github.com/ClickHouse/flink-connector-clickhouse")
}

organization {
name.set("ClickHouse")
url.set("https://clickhouse.com")
}

issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/ClickHouse/flink-connector-clickhouse/issues")
}
}
}
}
}

signing {
val signingKey = System.getenv("SIGNING_KEY")
val signingPassword = System.getenv("SIGNING_PASSWORD")
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["maven"])
}
}

nmcp {
publish("maven") {
username = System.getenv("NMCP_USERNAME")
password = System.getenv("NMCP_PASSWORD")
publicationType = "AUTOMATIC"
}
}
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@

org.gradle.configuration-cache=true

# if debugging gradle tasks is needed (enable 3 lines below)

#org.gradle.logging.level=debug
#systemProp.org.slf4j.simpleLogger.log.org.apache.http=DEBUG
#systemProp.org.slf4j.simpleLogger.log.org.apache.http.wire=DEBUG

Loading