Skip to content

Commit

Permalink
add publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ozer committed Dec 10, 2024
1 parent 8562081 commit 37e3bef
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release

on:
workflow_dispatch:

permissions:
contents: write

Expand Down Expand Up @@ -30,6 +30,14 @@ jobs:
with:
arguments: createConfluentArchive
gradle-version: '7.4.2'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Publish package
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.PACKAGES_WRITE_TOKEN }}

- name: release
uses: actions/create-release@v1
id: create_release
Expand All @@ -49,6 +57,7 @@ jobs:
asset_path: ./build/confluent/clickhouse-kafka-connect-${{ env.RELEASE_VERSION }}.zip
asset_name: clickhouse-kafka-connect-${{ env.RELEASE_VERSION }}.zip
asset_content_type: application/zip

- name: Tag latest commit as release
run: |
git config --local user.email "[email protected]"
Expand Down
23 changes: 22 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.net.URI

val defaultJdkVersion = 17
java {
Expand All @@ -35,9 +36,10 @@ plugins {
id("com.github.gmazzo.buildconfig") version "5.5.0"
id("com.diffplug.spotless") version "6.25.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("co.uzzu.dotenv.gradle") version "4.0.0" apply true
}

group = "com.clickhouse.kafka"
group = "com.airthings.clickhouse"
version = file("VERSION").readText().trim()
description = "The official ClickHouse Apache Kafka Connect Connector."

Expand Down Expand Up @@ -260,3 +262,22 @@ tasks.register<Zip>("createConfluentArchive") {
archiveVersion.set(project.version.toString())
destinationDirectory.set(file("$buildDir/confluent"))
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = URI("https://maven.pkg.github.com/airthings/clickhouse-kafka-connect")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}

publications {
register<MavenPublication>("gpr") {
from(components["java"])
}
}
}

0 comments on commit 37e3bef

Please sign in to comment.