Skip to content

Commit

Permalink
Some more release related changes (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
brfrn169 committed Jul 26, 2021
1 parent 60653b8 commit 0d0812a
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 194 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ jobs:
- name: Upload scalardb, scalardb-server, and scalardb-rpc to Maven Central Repository
run: |
echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > ~/.gradle/secring.gpg
gradle uploadArchives \
-Pversion=${{ steps.version.outputs.version }} \
gradle publish \
-Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \
-P'signing.password'="${{ secrets.SIGNING_PASSWORD }}" \
-Psigning.secretKeyRingFile="$(echo ~/.gradle/secring.gpg)" \
Expand Down
35 changes: 8 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ subprojects {
mavenCentral()
}

dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.16.0'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '2.16.0'
}

test {
maxHeapSize "512m"
testLogging.showStandardStreams = true
Expand All @@ -39,8 +32,16 @@ subprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8

java {
withJavadocJar()
withSourcesJar()
}

javadoc {
options.addStringOption("notimestamp", "com.scalar.db")
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}

distZip {
Expand All @@ -54,24 +55,4 @@ subprojects {
installDist {
duplicatesStrategy DuplicatesStrategy.EXCLUDE
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task testJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output
}

task testSourcesJar(type: Jar) {
classifier = 'test-sources'
from sourceSets.test.allSource
}
}
88 changes: 38 additions & 50 deletions core/archive.gradle
Original file line number Diff line number Diff line change
@@ -1,66 +1,54 @@
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'

artifacts {
archives javadocJar, sourcesJar, testJar, testSourcesJar
}

signing {
sign configurations.archives
}

configurations.archives.artifacts.removeAll {
// exclude from the archives configuration all artifacts that were generated by distZip & distTar
def depTasks = it.getBuildDependencies().getDependencies()
depTasks.contains(distZip) || depTasks.contains(distTar)
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name 'Scalar DB'
packaging 'jar'
// optionally artifactId can be defined here
description 'A library that makes non-ACID distributed databases/storages ACID-compliant.'
url 'https://github.com/scalar-labs/scalardb'

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'
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'scalardb'
from components.java
pom {
name = 'Scalar DB'
description = 'A library that makes non-ACID distributed databases/storages ACID-compliant'
url = 'https://github.com/scalar-labs/scalardb'
licenses {
license {
name 'Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0'
name = 'Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0'
}
}

developers {
developer {
id 'hiroyuki'
name 'Hiroyuki Yamada'
email '[email protected]'
id = 'hiroyuki'
name = 'Hiroyuki Yamada'
email = '[email protected]'
}
developer {
id 'brfrn169'
name 'Toshihiro Suzuki'
email '[email protected]'
id = 'brfrn169'
name = 'Toshihiro Suzuki'
email = '[email protected]'
}
}
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 = "${ossrhUsername}"
password = "${ossrhPassword}"
}
}
}
}

signing {
sign publishing.publications.mavenJava
}
15 changes: 6 additions & 9 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ dependencies {
implementation group: 'org.postgresql', name: 'postgresql', version: '42.2.18'
implementation group: 'com.oracle.database.jdbc', name: 'ojdbc8-production', version: '19.8.0.0'
implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '8.4.1.jre8'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.16.0'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '2.16.0'
}

task integrationTestCassandra(type: Test) {
Expand Down Expand Up @@ -154,19 +158,12 @@ task integrationTestMultiStorage(type: Test) {
outputs.upToDateWhen { false } // ensures integration tests are run every time when called
}

// build should not depend on the integration tests
check.dependsOn -= integrationTestCassandra
check.dependsOn -= integrationTestCosmos
check.dependsOn -= integrationTestDynamo
check.dependsOn -= integrationTestJdbc
check.dependsOn -= integrationTestMultiStorage

task copyDependencies(type: Copy) {
configurations.api.canBeResolved true
configurations.implementation.canBeResolved true
from(configurations.api + configurations.implementation)
into file("$buildDir/libs")
duplicatesStrategy 'exclude'
duplicatesStrategy DuplicatesStrategy.EXCLUDE
}

spotless {
Expand All @@ -182,6 +179,6 @@ archivesBaseName = "scalardb"

// for archiving and uploading to maven central
if (!project.gradle.startParameter.taskNames.isEmpty() &&
project.gradle.startParameter.taskNames[0].endsWith('uploadArchives')) {
project.gradle.startParameter.taskNames[0].endsWith('publish')) {
apply from: 'archive.gradle'
}
88 changes: 38 additions & 50 deletions rpc/archive.gradle
Original file line number Diff line number Diff line change
@@ -1,66 +1,54 @@
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'signing'

artifacts {
archives javadocJar, sourcesJar, testJar, testSourcesJar
}

signing {
sign configurations.archives
}

configurations.archives.artifacts.removeAll {
// exclude from the archives configuration all artifacts that were generated by distZip & distTar
def depTasks = it.getBuildDependencies().getDependencies()
depTasks.contains(distZip) || depTasks.contains(distTar)
}

uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name 'Scalar DB RPC'
packaging 'jar'
// optionally artifactId can be defined here
description 'Scalar DB RPC libraries'
url 'https://github.com/scalar-labs/scalardb'

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'
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'scalardb-rpc'
from components.java
pom {
name = 'Scalar DB RPC'
description = 'Scalar DB RPC libraries'
url = 'https://github.com/scalar-labs/scalardb'
licenses {
license {
name 'Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0'
name = 'Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0'
}
}

developers {
developer {
id 'hiroyuki'
name 'Hiroyuki Yamada'
email '[email protected]'
id = 'hiroyuki'
name = 'Hiroyuki Yamada'
email = '[email protected]'
}
developer {
id 'brfrn169'
name 'Toshihiro Suzuki'
email '[email protected]'
id = 'brfrn169'
name = 'Toshihiro Suzuki'
email = '[email protected]'
}
}
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 = "${ossrhUsername}"
password = "${ossrhPassword}"
}
}
}
}

signing {
sign publishing.publications.mavenJava
}
2 changes: 1 addition & 1 deletion rpc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ archivesBaseName = "scalardb-rpc"

// for archiving and uploading to maven central
if (!project.gradle.startParameter.taskNames.isEmpty() &&
project.gradle.startParameter.taskNames[0].endsWith('uploadArchives')) {
project.gradle.startParameter.taskNames[0].endsWith('publish')) {
apply from: 'archive.gradle'
}
Loading

0 comments on commit 0d0812a

Please sign in to comment.