xref: /aosp_15_r20/external/google-auth-library-java/.kokoro/release/publish_javadoc11.sh (revision af546375c95127f07cb26dd492629ccb2e8b1be1)
1#!/bin/bash
2# Copyright 2021 Google LLC
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16set -eo pipefail
17
18if [[ -z "${CREDENTIALS}" ]]; then
19  CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account
20fi
21
22if [[ -z "${STAGING_BUCKET_V2}" ]]; then
23  echo "Need to set STAGING_BUCKET_V2 environment variable"
24  exit 1
25fi
26
27# work from the git root directory
28pushd $(dirname "$0")/../../
29
30# install docuploader package
31python3 -m pip install --require-hashes -r .kokoro/requirements.txt
32
33# compile all packages
34mvn clean install -B -q -DskipTests=true
35
36export NAME=google-auth-library
37export VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)
38
39# cloud RAD generation
40mvn clean javadoc:aggregate -B -q -P docFX
41# include CHANGELOG
42cp CHANGELOG.md target/docfx-yml/history.md
43
44pushd target/docfx-yml
45
46# create metadata
47python3 -m docuploader create-metadata \
48 --name ${NAME} \
49 --version ${VERSION} \
50 --xrefs devsite://java/gax \
51 --xrefs devsite://java/google-cloud-core \
52 --xrefs devsite://java/api-common \
53 --xrefs devsite://java/proto-google-common-protos \
54 --xrefs devsite://java/google-api-client \
55 --xrefs devsite://java/google-http-client \
56 --xrefs devsite://java/protobuf \
57 --language java
58
59# upload yml to production bucket
60python3 -m docuploader upload . \
61 --credentials ${CREDENTIALS} \
62 --staging-bucket ${STAGING_BUCKET_V2} \
63 --destination-prefix docfx
64