xref: /aosp_15_r20/external/google-java-format/util/publish-snapshot-on-commit.sh (revision 10816b529e1d7005ca788e7b4c5efd1c72957e26)
1# Copyright 2020 Google Inc.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# https://github.com/google/dagger/blob/master/util/publish-snapshot-on-commit.sh
16
17if [ "$TRAVIS_REPO_SLUG" == "google/google-java-format" ] && \
18   [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && \
19   [ "$TRAVIS_PULL_REQUEST" == "false" ] && \
20   [ "$TRAVIS_BRANCH" == "master" ]; then
21  echo -e "Publishing maven snapshot...\n"
22
23  mvn clean source:jar deploy --settings="util/settings.xml" -DskipTests=true -Dinvoker.skip=true -Dmaven.javadoc.skip=true
24
25  echo -e "Published maven snapshot"
26fi
27