diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg index c49930316..79d4be8da 100644 --- a/.kokoro/release/stage.cfg +++ b/.kokoro/release/stage.cfg @@ -5,3 +5,33 @@ env_vars: { key: "TRAMPOLINE_BUILD_FILE" value: "github/google-http-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 3b6794c27..592dd61a2 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 pushd $(dirname "$0")/../../ @@ -22,11 +26,18 @@ pushd $(dirname "$0")/../../ setup_environment_secrets create_settings_xml_file "settings.xml" +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 5ed395c5a..5807af150 100644 --- a/pom.xml +++ b/pom.xml @@ -257,7 +257,7 @@ ossrh https://oss.sonatype.org/ - false + ${deploy.autorelease} @@ -554,6 +554,7 @@ 4.5.8 0.21.0 .. + false