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
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
template: |
## What's Changed
$CHANGES
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches: [ main ]
push:
branches: [ main ]
tags: [ v* ]

permissions:
contents: write # auto-merge requirement
Expand Down Expand Up @@ -43,6 +44,14 @@ jobs:
name: test-results-java-${{ matrix.java }}
path: '**/build/test-results/test/TEST-*.xml'

- name: Prepare release notes
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')
uses: release-drafter/release-drafter@v7
with:
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

spring-compat:
name: "Spring Boot ${{ matrix.spring-boot }}"
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -86,6 +95,48 @@ jobs:
- name: Test okapi-kafka
run: ./gradlew :okapi-kafka:test -PkafkaVersion=${{ matrix.kafka }}

publish:
name: Publish to Maven Central
needs: [build, spring-compat, kafka-compat]
runs-on: ubuntu-24.04
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1

- name: Publish to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.PGP_SECRET }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.PGP_PASSPHRASE }}

- name: Extract version from tag
run: |
version=${GITHUB_REF/refs\/tags\/v/}
echo "VERSION=$version" >> $GITHUB_ENV
- name: Publish release notes
uses: release-drafter/release-drafter@v7
with:
config-name: release-drafter.yml
publish: true
name: "v${{ env.VERSION }}"
tag: "v${{ env.VERSION }}"
version: "v${{ env.VERSION }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

auto-merge-dependabot:
# only for PRs by dependabot[bot]
if: github.event.pull_request.user.login == 'dependabot[bot]'
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ kotlin {
dependencies {
implementation(libs.kotlinGradlePlugin)
implementation(libs.ktlintGradlePlugin)
implementation(libs.vanniktechPublishPlugin)
}
34 changes: 34 additions & 0 deletions buildSrc/src/main/kotlin/publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package buildsrc.convention

plugins {
id("com.vanniktech.maven.publish")
}

mavenPublishing {
publishToMavenCentral()
signAllPublications()

pom {
name.set(project.name)
description.set(provider { project.description ?: "Transactional outbox pattern for Kotlin/JVM" })
url.set("https://github.com/softwaremill/okapi")
licenses {
license {
name.set("Apache-2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0")
}
}
developers {
developer {
id.set("softwaremill")
name.set("SoftwareMill")
url.set("https://softwaremill.com")
}
}
scm {
connection.set("scm:git:git://github.com/softwaremill/okapi.git")
developerConnection.set("scm:git:ssh://github.com/softwaremill/okapi.git")
url.set("https://github.com/softwaremill/okapi")
}
}
}
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ org.gradle.caching=true
# (Note that some plugins may not yet be compatible with the configuration cache.)
# https://docs.gradle.org/current/userguide/configuration_cache.html
org.gradle.configuration-cache=true

GROUP=com.softwaremill.okapi
VERSION_NAME=0.1.0
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ mysql = "9.6.0"
kafkaClients = "4.2.0"
spring = "7.0.6"
springBoot = "4.0.5"
vanniktechPublish = "0.36.0"
wiremock = "3.13.2"
slf4j = "2.0.17"
assertj = "3.27.7"

[libraries]
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
ktlintGradlePlugin = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint" }
vanniktechPublishPlugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "vanniktechPublish" }
kotestRunnerJunit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
kotestAssertionsCore = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
exposedCore = { module = "org.jetbrains.exposed:exposed-core", version.ref = "exposed" }
Expand Down
3 changes: 3 additions & 0 deletions okapi-bom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins {
`java-platform`
id("buildsrc.convention.publish")
}

description = "BOM for consistent versioning of Okapi modules"

dependencies {
constraints {
api(project(":okapi-core"))
Expand Down
3 changes: 3 additions & 0 deletions okapi-core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins {
id("buildsrc.convention.kotlin-jvm")
id("buildsrc.convention.publish")
}

description = "Core outbox abstractions and processing engine"

dependencies {
implementation(libs.slf4jApi)
testImplementation(libs.kotestRunnerJunit5)
Expand Down
3 changes: 3 additions & 0 deletions okapi-http/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins {
id("buildsrc.convention.kotlin-jvm")
id("buildsrc.convention.publish")
}

description = "HTTP message delivery for outbox entries"

dependencies {
implementation(project(":okapi-core"))
implementation(libs.jacksonModuleKotlin)
Expand Down
3 changes: 3 additions & 0 deletions okapi-kafka/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins {
id("buildsrc.convention.kotlin-jvm")
id("buildsrc.convention.publish")
}

description = "Apache Kafka message delivery"

dependencies {
implementation(project(":okapi-core"))
implementation(libs.jacksonModuleKotlin)
Expand Down
3 changes: 3 additions & 0 deletions okapi-mysql/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins {
id("buildsrc.convention.kotlin-jvm")
id("buildsrc.convention.publish")
}

description = "MySQL outbox store using Exposed"

dependencies {
implementation(project(":okapi-core"))

Expand Down
3 changes: 3 additions & 0 deletions okapi-postgres/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins {
id("buildsrc.convention.kotlin-jvm")
id("buildsrc.convention.publish")
}

description = "PostgreSQL outbox store using Exposed"

dependencies {
implementation(project(":okapi-core"))

Expand Down
3 changes: 3 additions & 0 deletions okapi-spring-boot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
plugins {
id("buildsrc.convention.kotlin-jvm")
id("buildsrc.convention.publish")
}

description = "Spring Boot autoconfiguration for Okapi"

dependencies {
implementation(project(":okapi-core"))

Expand Down