Skip to content

Commit 3b44fc7

Browse files
Create and publish snapshot version of data loader core (#2736)
Co-authored-by: Peckstadt Yves <[email protected]>
1 parent e7c8b7a commit 3b44fc7

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed

.github/workflows/release-snapshot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
VERSION=$(./gradlew :core:properties -q | grep "version:" | awk '{print $2}')
3131
echo "version=${VERSION}" >> $GITHUB_OUTPUT
3232
33-
- name: Upload SNAPSHOT versions for scalardb, scalardb-schema-loader, and scalardb-integration-test to Maven Snapshot Repository
33+
- name: Upload SNAPSHOT versions for scalardb, scalardb-schema-loader, scalardb-data-loader-core, and scalardb-integration-test to Maven Snapshot Repository
3434
if: contains(steps.version.outputs.version, '-SNAPSHOT')
3535
run: |
3636
echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > ~/.gradle/secring.gpg

.github/workflows/upload-artifacts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
run: |
5858
docker push ghcr.io/scalar-labs/scalardb-schema-loader:${{ steps.version.outputs.version }}
5959
60-
- name: Upload scalardb, scalardb-schema-loader, and scalardb-integration-test to Maven Central Repository
60+
- name: Upload scalardb, scalardb-schema-loader, scalardb-data-loader-core, and scalardb-integration-test to Maven Central Repository
6161
run: |
6262
echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > ~/.gradle/secring.gpg
6363
./gradlew publish \

data-loader/core/build.gradle

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ plugins {
22
id 'net.ltgt.errorprone' version "${errorpronePluginVersion}"
33
id 'com.github.johnrengelman.shadow' version "${shadowPluginVersion}"
44
id 'com.github.spotbugs' version "${spotbugsPluginVersion}"
5+
id 'maven-publish'
6+
id 'signing'
7+
id 'base'
58
}
69

710
archivesBaseName = "scalardb-data-loader-core"
@@ -41,3 +44,67 @@ spotbugsTest.reports {
4144
html.enabled = true
4245
}
4346
spotbugsTest.excludeFilter = file("${project.rootDir}/gradle/spotbugs-exclude.xml")
47+
48+
if (project.gradle.startParameter.taskNames.any { it.endsWith('publish') } ||
49+
project.gradle.startParameter.taskNames.any { it.endsWith('publishToMavenLocal') }) {
50+
// not to publish the fat jar to maven central
51+
shadowJar.enabled = false
52+
}
53+
54+
publishing {
55+
publications {
56+
mavenJava(MavenPublication) {
57+
artifactId = 'scalardb-data-loader-core'
58+
from components.java
59+
pom {
60+
name = 'ScalarDB Data Loader Core'
61+
description = 'Core library for exporting data from and importing data into ScalarDB'
62+
url = 'https://github.com/scalar-labs/scalardb'
63+
licenses {
64+
license {
65+
name = 'Apache License, Version 2.0'
66+
url = 'http://www.apache.org/licenses/LICENSE-2.0'
67+
}
68+
}
69+
developers {
70+
developer {
71+
id = 'hiroyuki'
72+
name = 'Hiroyuki Yamada'
73+
74+
}
75+
developer {
76+
id = 'brfrn169'
77+
name = 'Toshihiro Suzuki'
78+
79+
}
80+
developer {
81+
id = 'Torch3333'
82+
name = 'Vincent Guilpain'
83+
84+
}
85+
}
86+
scm {
87+
connection = 'scm:git:https://github.com/scalar-labs/scalardb.git'
88+
developerConnection = 'scm:git:https://github.com/scalar-labs/scalardb.git'
89+
url = 'https://github.com/scalar-labs/scalardb'
90+
}
91+
}
92+
}
93+
}
94+
repositories {
95+
maven {
96+
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
97+
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
98+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
99+
credentials {
100+
username = project.properties['ossrhUsername'] ?: ""
101+
password = project.properties['ossrhPassword'] ?: ""
102+
}
103+
}
104+
}
105+
}
106+
107+
signing {
108+
required { project.gradle.taskGraph.hasTask("publish") }
109+
sign publishing.publications.mavenJava
110+
}

0 commit comments

Comments
 (0)