xref: /aosp_15_r20/external/google-auth-library-java/.kokoro/release/publish_javadoc.sh (revision af546375c95127f07cb26dd492629ccb2e8b1be1)
1#!/bin/bash
2# Copyright 2019 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}" ]]; then
23  echo "Need to set STAGING_BUCKET 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# build the docs
40mvn site -B -q
41
42pushd target/site/apidocs
43
44# create metadata
45python3 -m docuploader create-metadata \
46  --name ${NAME} \
47  --version ${VERSION} \
48  --language java
49
50# upload docs
51python3 -m docuploader upload . \
52  --credentials ${CREDENTIALS} \
53  --staging-bucket ${STAGING_BUCKET}
54