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
22 changes: 8 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,6 @@ artifacts {
archives javadocJar
}

import org.gradle.plugins.signing.Sign
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {
allprojects { ext."signing.keyId" = System.getenv('GPG_KEY_ID') }
allprojects { ext."signing.secretKeyRingFile" = System.getenv('GPG_KEY_LOCATION') }
allprojects { ext."signing.password" = System.getenv('GPG_PASSPHRASE') }
}
// Do not sign archives by default (a local build without gpg keyring should succeed)
if (taskGraph.allTasks.any { it.name == 'build' || it.name == 'assemble' }) {
tasks.findAll { it.name == 'signArchives' || it.name == 'signDocsJar' || it.name == 'signTestJar' }.each { task ->
task.enabled = false
}
}
}

publishing {
publications {
Expand Down Expand Up @@ -201,6 +187,14 @@ publishing {
}
}

ext.isReleaseVersion = getProjectProperty('TILEDB_JAVA_RELEASE').toBoolean()
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
allprojects { ext."signing.keyId" = System.getenv('GPG_KEY_ID') }
allprojects { ext."signing.secretKeyRingFile" = System.getenv('GPG_KEY_LOCATION') }
allprojects { ext."signing.password" = System.getenv('GPG_PASSPHRASE') }
}

signing {
sign publishing.publications.mavenJava
sign configurations.archives
Expand Down
1 change: 1 addition & 0 deletions ci/upload_to_maven.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ echo "${GPG_SECRET_KEYS_ENC}" | base64 --decode > ${ENCRYPTED_GPG_KEY_LOCATION}
openssl aes-256-cbc -K $encrypted_a2869fb015d7_key -iv $encrypted_a2869fb015d7_iv -in $ENCRYPTED_GPG_KEY_LOCATION -out $GPG_KEY_LOCATION -d
./gradlew properties -q | grep "version:" | awk '{print $2}'
export PROJECT_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')
export ORG_GRADLE_PROJECT_TILEDB_JAVA_RELEASE=true
# Upload only snapshots to sonatype oss so it can make its way to maven central
./gradlew publishMavenJavaPublicationToMavenRepository

Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
TILEDB_JAVA_RELEASE=false
TILEDB_GIT_REPOSITORY=https://github.com/TileDB-Inc/TileDB
TILEDB_GIT_TAG=dev
TILEDB_VERBOSE=OFF
Expand Down