diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg index dcf8f7364..8defcfb20 100644 --- a/.kokoro/release/stage.cfg +++ b/.kokoro/release/stage.cfg @@ -5,3 +5,33 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/google-api-java-client/.kokoro/release/stage.sh" } + +# Fetch the token needed for reporting release status to GitHub +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "yoshi-automation-github-key" + } + } +} + +# Fetch magictoken to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "releasetool-magictoken" + } + } +} + +# Fetch api key to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "magic-github-proxy-api-key" + } + } +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh index 118c44ccd..0d873156a 100755 --- a/.kokoro/release/stage.sh +++ b/.kokoro/release/stage.sh @@ -15,6 +15,10 @@ set -eo pipefail +# Start the releasetool reporter +python3 -m pip install gcp-releasetool +python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script + source $(dirname "$0")/common.sh source $(dirname "$0")/../install_dependencies.sh @@ -23,11 +27,18 @@ pushd $(dirname "$0")/../../ setup_environment_secrets create_settings_xml_file "settings.xml" -mvn clean install deploy \ +AUTORELEASE="false" +if [[ -n "${AUTORELEASE_PR}" ]] +then + AUTORELEASE="true" +fi + +mvn clean install deploy -B \ --settings settings.xml \ -DperformRelease=true \ -Dgpg.executable=gpg \ -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GPG_HOMEDIR} + -Dgpg.homedir=${GPG_HOMEDIR} \ + -Ddeploy.autorelease=${AUTORELEASE} diff --git a/pom.xml b/pom.xml index f7a8b6a95..f354a4054 100644 --- a/pom.xml +++ b/pom.xml @@ -234,7 +234,7 @@ ossrh https://oss.sonatype.org/ - false + ${deploy.autorelease} @@ -512,6 +512,7 @@ 4.0.3 2.5 1.1 + false