xref: /aosp_15_r20/external/google-auth-library-java/.kokoro/release/snapshot.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
18source $(dirname "$0")/common.sh
19MAVEN_SETTINGS_FILE=$(realpath $(dirname "$0")/../../)/settings.xml
20pushd $(dirname "$0")/../../
21
22# ensure we're trying to push a snapshot (no-result returns non-zero exit code)
23grep SNAPSHOT versions.txt
24
25setup_environment_secrets
26create_settings_xml_file "settings.xml"
27
28mvn clean deploy -B \
29  --settings ${MAVEN_SETTINGS_FILE} \
30  -DperformRelease=true \
31  -Dgpg.executable=gpg \
32  -Dgpg.passphrase=${GPG_PASSPHRASE} \
33  -Dgpg.homedir=${GPG_HOMEDIR}
34