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