Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
build: make this repo match gax-java's release configuration (#162)
Browse files Browse the repository at this point in the history
This should allow the closeAndReleaseRepository to work for autorelease.
  • Loading branch information
chingor13 committed Oct 16, 2020
1 parent e6f8fef commit 668d62a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .kokoro/release/stage.sh
Expand Up @@ -30,7 +30,7 @@ setup_environment_secrets
mkdir -p ${HOME}/.gradle
create_gradle_properties_file "${HOME}/.gradle/gradle.properties"

./gradlew assemble uploadArchives
./gradlew assemble publish

if [[ -n "${AUTORELEASE_PR}" ]]
then
Expand Down
74 changes: 49 additions & 25 deletions build.gradle
Expand Up @@ -21,6 +21,7 @@ apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: 'com.github.sherter.google-java-format'
apply plugin: 'io.codearte.nexus-staging'

Expand Down Expand Up @@ -198,51 +199,74 @@ signing {
}

if (project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')) {
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
nexusStaging {
username = ossrhUsername
password = ossrhPassword
packageGroup = "com.google.api"
}
}

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
afterEvaluate {
publishing {
publications {
mavenJava(MavenPublication) {
version = project.version

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

artifact javadocJar
artifact sourcesJar

pom.project {
name 'API Common'
packaging 'jar'
artifactId 'api-common'
description 'Common utilities for Google APIs in Java'
url 'https://github.com/googleapis/api-common-java'
pom {
name = 'API Common'
packaging = 'jar'
artifactId = 'api-common'
description = 'Common utilities for Google APIs in Java'
url = 'https://github.com/googleapis/api-common-java'

scm {
url 'https://github.com/googleapis/api-common-java'
connection 'scm:git:https://github.com/googleapis/api-common-java.git'
url = 'https://github.com/googleapis/api-common-java'
connection = 'scm:git:https://github.com/googleapis/api-common-java.git'
}

licenses {
license {
name 'BSD'
url 'https://github.com/googleapis/api-common-java/blob/master/LICENSE'
name = 'BSD'
url = 'https://github.com/googleapis/api-common-java/blob/master/LICENSE'
}
}

developers {
developer {
id 'GoogleAPIs'
name 'GoogleAPIs'
email 'googleapis@googlegroups.com'
url 'https://github.com/googleapis'
id = 'GoogleAPIs'
name = 'GoogleAPIs'
email = 'googleapis@googlegroups.com'
url = 'https://github.com/googleapis'
organization = 'Google, Inc.'
organizationUrl 'https://www.google.com'
organizationUrl = 'https://www.google.com'
}
}
}
}
}
repositories {
maven {
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = project.hasProperty('ossrhUsername') ? project.getProperty('ossrhUsername') : null
password = project.hasProperty('ossrhPassword') ? project.getProperty('ossrhPassword') : null
}
}
}
}

signing {
if (!project.hasProperty('skip.signing')) {
if (project.hasProperty('signing.gnupg.executable')) {
useGpgCmd()
}
sign publishing.publications.mavenJava
}
}
}

Expand Down

0 comments on commit 668d62a

Please sign in to comment.