chore: Prepare for maven release by lqiu96 · Pull Request #383 · googleapis/api-common-java · GitHub
Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
Closed
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
2 changes: 1 addition & 1 deletion .kokoro/build.sh
13 changes: 0 additions & 13 deletions .kokoro/presubmit/clirr.cfg

This file was deleted.

26 changes: 0 additions & 26 deletions .kokoro/presubmit/common.cfg

This file was deleted.

31 changes: 22 additions & 9 deletions .kokoro/release/common.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2019 Google Inc.
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,12 +28,25 @@ setup_environment_secrets() {
export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|')
}

create_gradle_properties_file() {
create_settings_xml_file() {
echo "
signing.gnupg.executable=gpg
signing.gnupg.homeDir=${GPG_HOMEDIR}
signing.gnupg.keyName=${GPG_KEY_ID}
signing.gnupg.passphrase=${GPG_PASSPHRASE}
ossrhUsername=${SONATYPE_USERNAME}
ossrhPassword=${SONATYPE_PASSWORD}" > $1
}
<settings>
<servers>
<server>
<id>ossrh</id>
<username>${SONATYPE_USERNAME}</username>
<password>${SONATYPE_PASSWORD}</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>${SONATYPE_USERNAME}</username>
<password>${SONATYPE_PASSWORD}</password>
</server>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${SONATYPE_USERNAME}</username>
<password>${SONATYPE_PASSWORD}</password>
</server>
</servers>
</settings>" > $1
}
23 changes: 0 additions & 23 deletions .kokoro/release/publish_javadoc.cfg

This file was deleted.

52 changes: 0 additions & 52 deletions .kokoro/release/publish_javadoc.sh

This file was deleted.

21 changes: 14 additions & 7 deletions .kokoro/release/publish_javadoc11.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2019 Google Inc.
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,21 +28,28 @@ fi
pushd $(dirname "$0")/../../

# install docuploader package
python3 -m pip install gcp-docuploader
python3 -m pip install --require-hashes -r .kokoro/requirements.txt

NAME=api-common
VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)

# build the docs
./gradlew javadocCombinedV3
mvn -B -ntp \
-P docFX \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dcheckstyle.skip=true \
-Dflatten.skip=true \
-Danimal.sniffer.skip=true \
javadoc:aggregate

# copy README to tmp_docs dir and rename index.md
cp README.md tmp_docs/docfx-yml/index.md
# copy README to docfx-yml dir and rename index.md
cp README.md target/docfx-yml/index.md

# copy CHANGELOG to docfx-yml dir and rename history.md
cp CHANGELOG.md tmp_docs/docfx-yml/history.md
cp CHANGELOG.md target/docfx-yml/history.md

pushd tmp_docs/docfx-yml/
pushd target/docfx-yml/

# create metadata
python3 -m docuploader create-metadata \
Expand Down
27 changes: 23 additions & 4 deletions .kokoro/release/stage.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2019 Google Inc.
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,26 @@ MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml
pushd $(dirname "$0")/../../

setup_environment_secrets
mkdir -p ${HOME}/.gradle
create_gradle_properties_file "${HOME}/.gradle/gradle.properties"
create_settings_xml_file "settings.xml"

./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
mvn clean deploy -B \
-DskipTests=true \
-Dclirr.skip=true \
--settings ${MAVEN_SETTINGS_FILE} \
-Dgpg.executable=gpg \
-Dgpg.passphrase=${GPG_PASSPHRASE} \
-Dgpg.homedir=${GPG_HOMEDIR} \
-P release

# TODO: The step below will release the artifact to maven central. Uncomment when ready

## The job triggered by Release Please (release-trigger) has this AUTORELEASE_PR
## environment variable. Fusion also lets us to specify this variable.
#if [[ -n "${AUTORELEASE_PR}" ]]
#then
# mvn nexus-staging:release -B \
# -DperformRelease=true \
# --settings=${MAVEN_SETTINGS_FILE}
#else
# echo "AUTORELEASE_PR is not set. Not releasing."
#fi
34 changes: 34 additions & 0 deletions .kokoro/requirements.in
Loading