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
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 1.8
distribution: 'temurin'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/early-access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 1.8
distribution: 'temurin'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build -x setupJdks
- name: Publish SNAPSHOT to OSSRH
run: ./gradlew publish
- name: Publish SNAPSHOT to Maven Central Portal
run: ./gradlew publish jreleaserDeploy
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhToken: ${{ secrets.OSSRH_TOKEN }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
- name: Release SNAPSHOT with JReleaser
run: ./gradlew setupJdks jreleaserAssemble jreleaserFullRelease
env:
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,32 @@ permissions:
contents: write
packages: write

env:
VERSION: ${{ github.event.inputs.version }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 1.8
distribution: 'temurin'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew -Pversion=${{ github.event.inputs.version }} build -x setupJdks
- name: Publish to OSSRH
run: ./gradlew -Pversion=${{ github.event.inputs.version }} publish closeAndReleaseRepository
run: ./gradlew -Pversion="$VERSION" build -x setupJdks
- name: Publish to Maven Central Portal
run: ./gradlew -Pversion="$VERSION" publish jreleaserDeploy
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhToken: ${{ secrets.OSSRH_TOKEN }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
- name: Release
run: ./gradlew -Pversion=${{ github.event.inputs.version }} setupJdks jreleaserAssemble jreleaserFullRelease
run: ./gradlew -Pversion="$VERSION" setupJdks jreleaserAssemble jreleaserFullRelease
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_DOCKER_GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ local.properties
.gradle/**
build/
!gradle/wrapper
out/

######################
# Windows
Expand Down
22 changes: 20 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ plugins {
id("application")
id("java-library")
alias(libs.plugins.io.freefair.lombok)
alias(libs.plugins.io.codearte.nexus.staging)
alias(libs.plugins.org.jreleaser)
alias(libs.plugins.org.jreleaser.jdks)
}
Expand All @@ -21,9 +20,19 @@ repositories {

group = "com.github.differentway"
description = "Couchmove"
sourceCompatibility = "1.8"

// Build/test on a modern JDK via toolchain, but compile the shipped artifact
// to Java 8 bytecode so it stays runnable on customers' JDK 8 runtimes.
// Couchbase Java SDK 3.x supports JDK 8-25, so JDK 8 remains a valid target.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

compileJava {
// --release 8 also blocks accidental use of post-8 JDK APIs (not just bytecode level).
options.release = 8
options.compilerArgs += ["-Aproject=${project.group}/${project.name}"]
}

Expand All @@ -41,6 +50,9 @@ task integrationTest(type: Test) {
useJUnitPlatform()
description = "Execute integration tests."
group = "verification"
// Gradle 9 no longer wires a custom Test task to the test source set implicitly.
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
include "**/*IT*", "**/*IntTest*"

testLogging {
Expand All @@ -65,6 +77,7 @@ dependencies {
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.engine)
testImplementation(libs.junit.jupiter.params)
testRuntimeOnly(libs.junit.platform.launcher)
testImplementation(libs.testcontainers.couchbase)
testImplementation(libs.mockito.core)
testImplementation(libs.mockito.junit.jupiter)
Expand All @@ -73,3 +86,8 @@ dependencies {

apply from: "gradle/publish.gradle"
apply from: "gradle/jreleaser.gradle"

// JReleaser deploys from the local staging repo populated by `publish`.
tasks.named('jreleaserDeploy') {
dependsOn 'publish'
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=3.4-SNAPSHOT
version=3.5-SNAPSHOT
17 changes: 17 additions & 0 deletions gradle/jreleaser.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ jreleaser {
}
}

deploy {
maven {
mavenCentral {
sonatype {
active = 'ALWAYS'
url = 'https://central.sonatype.com/api/v1/publisher'
// Allow snapshot deployments (routed to the Central snapshot repo).
snapshotSupported = true
// Artifacts are signed by the Gradle signing plugin; the .asc
// files are already in the staging dir, so JReleaser must not sign.
sign = false
stagingRepository('build/staging-deploy')
}
}
}
}

release {
github {
overwrite = true
Expand Down
31 changes: 16 additions & 15 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
[versions]
io-freefair-lombok = "8.4"
io-codearte-nexus-staging = "0.21.2"
org-jreleaser = "1.7.0"
io-freefair-lombok = "9.5.0"
org-jreleaser = "1.24.0"

couchbase = "3.4.9"
slf4j = "2.0.7"
couchbase = "3.11.3"
slf4j = "2.0.17"
semver4j = "3.1.0"
intellij-annotations = "142.1"
commons-codec = "1.16.1"
commons_io = "2.13.0"
commons-codec = "1.18.0"
commons_io = "2.22.0"
commons_lang = "2.6"
guava = "32.1.2-jre"
picocli = "4.7.5"
guava = "33.6.0-jre"
picocli = "4.7.7"

#<editor-fold desc="test">
junit = "5.10.0"
testcontainers = "1.19.2"
mockito = "4.2.0"
assertj = "3.24.2"
logback = "1.3.11"
junit = "5.14.4"
junit-platform = "1.14.4"
testcontainers = "1.21.4"
mockito = "5.23.0"
assertj = "3.27.7"
# logback ships at runtime (implementation dep) -> keep Java 8 line (1.4/1.5 require Java 11)
logback = "1.3.15"
#</editor-fold>

[libraries]
Expand All @@ -37,6 +38,7 @@ picocli-codegen = { group = 'info.picocli', name = 'picocli-codegen', version.re
junit-jupiter-api = { group = 'org.junit.jupiter', name = 'junit-jupiter-api', version.ref = 'junit' }
junit-jupiter-engine = { group = 'org.junit.jupiter', name = 'junit-jupiter-engine', version.ref = 'junit' }
junit-jupiter-params = { group = 'org.junit.jupiter', name = 'junit-jupiter-params', version.ref = 'junit' }
junit-platform-launcher = { group = 'org.junit.platform', name = 'junit-platform-launcher', version.ref = 'junit-platform' }
testcontainers-couchbase = { group = 'org.testcontainers', name = 'couchbase', version.ref = 'testcontainers' }
mockito-core = { group = 'org.mockito', name = 'mockito-core', version.ref = 'mockito' }
mockito-junit-jupiter = { group = 'org.mockito', name = 'mockito-junit-jupiter', version.ref = 'mockito' }
Expand All @@ -46,6 +48,5 @@ logback-classic = { group = 'ch.qos.logback', name = 'logback-classic', version.

[plugins]
io-freefair-lombok = { id = "io.freefair.lombok", version.ref = "io-freefair-lombok" }
io-codearte-nexus-staging = { id = "io.codearte.nexus-staging", version.ref = "io-codearte-nexus-staging" }
org-jreleaser = { id = "org.jreleaser", version.ref = "org-jreleaser" }
org-jreleaser-jdks = { id = "org.jreleaser.jdks", version.ref = "org-jreleaser" }
36 changes: 9 additions & 27 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}

task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar, javadocJar
java {
withSourcesJar()
withJavadocJar()
}

publishing {
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = findProperty("ossrhUsername")
password = findProperty("ossrhToken")
}
// Stage artifacts locally; JReleaser deploys them to the Central Portal
// (OSSRH / oss.sonatype.org was sunset on 2025-06-30).
name = 'staging'
url = layout.buildDirectory.dir('staging-deploy')
}
}
publications {
mavenJava(MavenPublication) {
from components.java

artifact sourcesJar
artifact javadocJar

pom {
name = 'Couchmove'
packaging = 'jar'
Expand Down Expand Up @@ -65,11 +50,8 @@ publishing {
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
// Only sign when a key is provided (e.g. CI). Snapshots are published unsigned.
required = { signingKey != null && !version.toString().endsWith("SNAPSHOT") }
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}

nexusStaging {
username = findProperty("ossrhUsername")
password = findProperty("ossrhToken")
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 5 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading