From 2ba7e9e76ee24b36de79e1b42c0fbe07b68ac5e3 Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Wed, 28 May 2025 14:10:23 +0530 Subject: [PATCH 01/11] initial commit --- .github/workflows/release-snapshot.yaml | 2 +- data-loader/core/build.gradle | 65 +++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-snapshot.yaml b/.github/workflows/release-snapshot.yaml index 3c27f43383..341e025ead 100644 --- a/.github/workflows/release-snapshot.yaml +++ b/.github/workflows/release-snapshot.yaml @@ -30,7 +30,7 @@ jobs: VERSION=$(./gradlew :core:properties -q | grep "version:" | awk '{print $2}') echo "version=${VERSION}" >> $GITHUB_OUTPUT - - name: Upload SNAPSHOT versions for scalardb, scalardb-schema-loader, and scalardb-integration-test to Maven Snapshot Repository + - name: Upload SNAPSHOT versions for scalardb, scalardb-schema-loader, scalardb-data-loader-core, and scalardb-integration-test to Maven Snapshot Repository if: contains(steps.version.outputs.version, '-SNAPSHOT') run: | echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > ~/.gradle/secring.gpg diff --git a/data-loader/core/build.gradle b/data-loader/core/build.gradle index 5239fd42ef..d84e0db81d 100644 --- a/data-loader/core/build.gradle +++ b/data-loader/core/build.gradle @@ -41,3 +41,68 @@ spotbugsTest.reports { html.enabled = true } spotbugsTest.excludeFilter = file("${project.rootDir}/gradle/spotbugs-exclude.xml") + + +if (project.gradle.startParameter.taskNames.any { it.endsWith('publish') } || + project.gradle.startParameter.taskNames.any { it.endsWith('publishToMavenLocal') }) { + // not to publish the fat jar to maven central + shadowJar.enabled = false +} + +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'scalardb-data-loader' + from components.java + pom { + name = 'ScalarDB Data Loader' + description = 'A tool for importing data to and from ScalarDB' + url = 'https://github.com/scalar-labs/scalardb' + licenses { + license { + name = 'Apache License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0' + } + } + developers { + developer { + id = 'hiroyuki' + name = 'Hiroyuki Yamada' + email = 'hiroyuki.yamada@scalar-labs.com' + } + developer { + id = 'brfrn169' + name = 'Toshihiro Suzuki' + email = 'brfrn169@gmail.com' + } + developer { + id = 'Torch3333' + name = 'Vincent Guilpain' + email = 'vincent.guilpain@scalar-labs.com' + } + } + scm { + connection = 'scm:git:https://github.com/scalar-labs/scalardb.git' + developerConnection = 'scm:git:https://github.com/scalar-labs/scalardb.git' + url = 'https://github.com/scalar-labs/scalardb' + } + } + } + } + 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 = project.properties['ossrhUsername'] ?: "" + password = project.properties['ossrhPassword'] ?: "" + } + } + } +} + +signing { + required { project.gradle.taskGraph.hasTask("publish") } + sign publishing.publications.mavenJava +} \ No newline at end of file From 048f1d52322ac4a92b97e9d431f7d9871ea68eb6 Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Wed, 28 May 2025 15:21:10 +0530 Subject: [PATCH 02/11] Plugins added --- data-loader/core/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data-loader/core/build.gradle b/data-loader/core/build.gradle index d84e0db81d..ae1a9d3a9e 100644 --- a/data-loader/core/build.gradle +++ b/data-loader/core/build.gradle @@ -2,6 +2,9 @@ plugins { id 'net.ltgt.errorprone' version "${errorpronePluginVersion}" id 'com.github.johnrengelman.shadow' version "${shadowPluginVersion}" id 'com.github.spotbugs' version "${spotbugsPluginVersion}" + id 'maven-publish' + id 'signing' + id 'base' } archivesBaseName = "scalardb-data-loader-core" From 5aafe77d31a0a58beb564c0fc4fd6990bda07c41 Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Wed, 28 May 2025 18:10:25 +0530 Subject: [PATCH 03/11] sample workflow for test added --- .../release-snapshot-data-loader.yaml | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/release-snapshot-data-loader.yaml diff --git a/.github/workflows/release-snapshot-data-loader.yaml b/.github/workflows/release-snapshot-data-loader.yaml new file mode 100644 index 0000000000..2951830205 --- /dev/null +++ b/.github/workflows/release-snapshot-data-loader.yaml @@ -0,0 +1,38 @@ +name: Release SNAPSHOT + +on: + workflow_dispatch: + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Set version + id: version + run: | + VERSION=$(./gradlew :core:properties -q | grep "version:" | awk '{print $2}') + echo "version=${VERSION}" >> $GITHUB_OUTPUT + + - name: Upload SNAPSHOT versions for scalardb-data-loader-core to Maven Snapshot Repository + if: contains(steps.version.outputs.version, '-SNAPSHOT') + run: | + echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > ~/.gradle/secring.gpg + ./gradlew data-loader:core:publish \ + -Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \ + -P'signing.password'="${{ secrets.SIGNING_PASSWORD }}" \ + -Psigning.secretKeyRingFile="$(echo ~/.gradle/secring.gpg)" \ + -PossrhUsername="${{ secrets.OSSRH_USERNAMAE }}" \ + -PossrhPassword="${{ secrets.OSSRH_PASSWORD }}" + From 56d765ec844d10a7b17f39106ef91328ab79b92d Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Wed, 4 Jun 2025 12:24:11 +0530 Subject: [PATCH 04/11] Snapshot creation test --- .github/workflows/release-snapshot-data-loader.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release-snapshot-data-loader.yaml b/.github/workflows/release-snapshot-data-loader.yaml index 2951830205..224abcd006 100644 --- a/.github/workflows/release-snapshot-data-loader.yaml +++ b/.github/workflows/release-snapshot-data-loader.yaml @@ -1,7 +1,6 @@ name: Release SNAPSHOT -on: - workflow_dispatch: +on: push jobs: release: From adf71f6d8c3fa978342cb2b33417500303b31d7c Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Wed, 4 Jun 2025 13:15:14 +0530 Subject: [PATCH 05/11] Removed test workflow --- .../release-snapshot-data-loader.yaml | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/release-snapshot-data-loader.yaml diff --git a/.github/workflows/release-snapshot-data-loader.yaml b/.github/workflows/release-snapshot-data-loader.yaml deleted file mode 100644 index 224abcd006..0000000000 --- a/.github/workflows/release-snapshot-data-loader.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Release SNAPSHOT - -on: push - -jobs: - release: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK 8 - uses: actions/setup-java@v4 - with: - java-version: '8' - distribution: 'temurin' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Set version - id: version - run: | - VERSION=$(./gradlew :core:properties -q | grep "version:" | awk '{print $2}') - echo "version=${VERSION}" >> $GITHUB_OUTPUT - - - name: Upload SNAPSHOT versions for scalardb-data-loader-core to Maven Snapshot Repository - if: contains(steps.version.outputs.version, '-SNAPSHOT') - run: | - echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > ~/.gradle/secring.gpg - ./gradlew data-loader:core:publish \ - -Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \ - -P'signing.password'="${{ secrets.SIGNING_PASSWORD }}" \ - -Psigning.secretKeyRingFile="$(echo ~/.gradle/secring.gpg)" \ - -PossrhUsername="${{ secrets.OSSRH_USERNAMAE }}" \ - -PossrhPassword="${{ secrets.OSSRH_PASSWORD }}" - From 93b3381a870ce3da66a96e99a84678b6724b1b4d Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Wed, 4 Jun 2025 13:32:25 +0530 Subject: [PATCH 06/11] Added new line --- data-loader/core/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-loader/core/build.gradle b/data-loader/core/build.gradle index ae1a9d3a9e..dcd04b912b 100644 --- a/data-loader/core/build.gradle +++ b/data-loader/core/build.gradle @@ -108,4 +108,4 @@ publishing { signing { required { project.gradle.taskGraph.hasTask("publish") } sign publishing.publications.mavenJava -} \ No newline at end of file +} From f0f8c20430689719f555f1541fc5342225b31dea Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Wed, 4 Jun 2025 17:03:21 +0530 Subject: [PATCH 07/11] Removed empty line --- data-loader/core/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/data-loader/core/build.gradle b/data-loader/core/build.gradle index dcd04b912b..1258ac885e 100644 --- a/data-loader/core/build.gradle +++ b/data-loader/core/build.gradle @@ -45,7 +45,6 @@ spotbugsTest.reports { } spotbugsTest.excludeFilter = file("${project.rootDir}/gradle/spotbugs-exclude.xml") - if (project.gradle.startParameter.taskNames.any { it.endsWith('publish') } || project.gradle.startParameter.taskNames.any { it.endsWith('publishToMavenLocal') }) { // not to publish the fat jar to maven central From e8e32c3082a39a6542e2dc727f80060af6912b72 Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Thu, 5 Jun 2025 10:22:19 +0530 Subject: [PATCH 08/11] Name updated in upload-artifacts --- .github/workflows/upload-artifacts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-artifacts.yaml b/.github/workflows/upload-artifacts.yaml index 02bc787680..3a0635c954 100644 --- a/.github/workflows/upload-artifacts.yaml +++ b/.github/workflows/upload-artifacts.yaml @@ -57,7 +57,7 @@ jobs: run: | docker push ghcr.io/scalar-labs/scalardb-schema-loader:${{ steps.version.outputs.version }} - - name: Upload scalardb, scalardb-schema-loader, and scalardb-integration-test to Maven Central Repository + - name: Upload scalardb, scalardb-schema-loader, scalardb-data-loader-core, and scalardb-integration-test to Maven Central Repository run: | echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > ~/.gradle/secring.gpg ./gradlew publish \ From 458ebc869f17b68a1feef53c30192dafe328acd6 Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Thu, 5 Jun 2025 11:28:12 +0530 Subject: [PATCH 09/11] Updated description --- data-loader/core/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-loader/core/build.gradle b/data-loader/core/build.gradle index 1258ac885e..8bf846e689 100644 --- a/data-loader/core/build.gradle +++ b/data-loader/core/build.gradle @@ -58,7 +58,7 @@ publishing { from components.java pom { name = 'ScalarDB Data Loader' - description = 'A tool for importing data to and from ScalarDB' + description = 'A tool for exporting data from and importing data into ScalarDB' url = 'https://github.com/scalar-labs/scalardb' licenses { license { From 7d42cbee93b4cc8c1e89a5090b8e53e301365061 Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Thu, 5 Jun 2025 11:34:05 +0530 Subject: [PATCH 10/11] Updated artifact id --- data-loader/core/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-loader/core/build.gradle b/data-loader/core/build.gradle index 8bf846e689..cbaa4cff99 100644 --- a/data-loader/core/build.gradle +++ b/data-loader/core/build.gradle @@ -54,7 +54,7 @@ if (project.gradle.startParameter.taskNames.any { it.endsWith('publish') } || publishing { publications { mavenJava(MavenPublication) { - artifactId = 'scalardb-data-loader' + artifactId = 'scalardb-data-loader-core' from components.java pom { name = 'ScalarDB Data Loader' From 08bf8e4ac43ff6b180b7574d02f16a82154adb9b Mon Sep 17 00:00:00 2001 From: Jishnu J Date: Thu, 5 Jun 2025 13:13:09 +0530 Subject: [PATCH 11/11] name and description updated --- data-loader/core/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data-loader/core/build.gradle b/data-loader/core/build.gradle index cbaa4cff99..4c66c65712 100644 --- a/data-loader/core/build.gradle +++ b/data-loader/core/build.gradle @@ -57,8 +57,8 @@ publishing { artifactId = 'scalardb-data-loader-core' from components.java pom { - name = 'ScalarDB Data Loader' - description = 'A tool for exporting data from and importing data into ScalarDB' + name = 'ScalarDB Data Loader Core' + description = 'Core library for exporting data from and importing data into ScalarDB' url = 'https://github.com/scalar-labs/scalardb' licenses { license {