Skip to content

Commit 0ee7fbb

Browse files
authored
Enable autorelease (#703)
1 parent 509ab96 commit 0ee7fbb

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

.kokoro/release/stage.cfg

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,33 @@ env_vars: {
55
key: "TRAMPOLINE_BUILD_FILE"
66
value: "github/google-http-java-client/.kokoro/release/stage.sh"
77
}
8+
9+
# Fetch the token needed for reporting release status to GitHub
10+
before_action {
11+
fetch_keystore {
12+
keystore_resource {
13+
keystore_config_id: 73713
14+
keyname: "yoshi-automation-github-key"
15+
}
16+
}
17+
}
18+
19+
# Fetch magictoken to use with Magic Github Proxy
20+
before_action {
21+
fetch_keystore {
22+
keystore_resource {
23+
keystore_config_id: 73713
24+
keyname: "releasetool-magictoken"
25+
}
26+
}
27+
}
28+
29+
# Fetch api key to use with Magic Github Proxy
30+
before_action {
31+
fetch_keystore {
32+
keystore_resource {
33+
keystore_config_id: 73713
34+
keyname: "magic-github-proxy-api-key"
35+
}
36+
}
37+
}

.kokoro/release/stage.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,29 @@
1515

1616
set -eo pipefail
1717

18+
# Start the releasetool reporter
19+
python3 -m pip install gcp-releasetool
20+
python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script
21+
1822
source $(dirname "$0")/common.sh
1923

2024
pushd $(dirname "$0")/../../
2125

2226
setup_environment_secrets
2327
create_settings_xml_file "settings.xml"
2428

29+
AUTORELEASE="false"
30+
if [[ -n "${AUTORELEASE_PR}" ]]
31+
then
32+
AUTORELEASE="true"
33+
fi
34+
2535
mvn clean install deploy -B \
2636
--settings settings.xml \
2737
-DperformRelease=true \
2838
-Dgpg.executable=gpg \
2939
-Dgpg.passphrase=${GPG_PASSPHRASE} \
30-
-Dgpg.homedir=${GPG_HOMEDIR}
40+
-Dgpg.homedir=${GPG_HOMEDIR} \
41+
-Ddeploy.autorelease=${AUTORELEASE}
3142

3243

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
<configuration>
258258
<serverId>ossrh</serverId>
259259
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
260-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
260+
<autoReleaseAfterClose>${deploy.autorelease}</autoReleaseAfterClose>
261261
</configuration>
262262
</plugin>
263263
<plugin>
@@ -554,6 +554,7 @@
554554
<project.httpclient.version>4.5.8</project.httpclient.version>
555555
<project.opencensus.version>0.21.0</project.opencensus.version>
556556
<project.root-directory>..</project.root-directory>
557+
<deploy.autorelease>false</deploy.autorelease>
557558
</properties>
558559

559560
<profiles>

0 commit comments

Comments
 (0)