blob: 967bc917e8f350781de0d71f1d6d5a9688e646ee [file] [log] [blame]
Bu Sun Kim65e33c02019-10-25 10:45:00 -07001#!/bin/bash
Yoshi Automation Bot218a1592020-07-06 13:59:22 -07002# Copyright 2020 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# https://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.
Bu Sun Kim65e33c02019-10-25 10:45:00 -070015
16set -eo pipefail
17
18# Start the releasetool reporter
19python3 -m pip install gcp-releasetool
20python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script
21
22# Ensure that we have the latest versions of Twine, Wheel, and Setuptools.
23python3 -m pip install --upgrade twine wheel setuptools
24
25# Disable buffering, so that the logs stream through.
26export PYTHONUNBUFFERED=1
27
28# Move into the package, build the distribution and upload.
Anthonios Partheniou9f837642021-06-01 14:54:59 -040029TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token")
Bu Sun Kim65e33c02019-10-25 10:45:00 -070030cd github/google-auth-library-python
31python3 setup.py sdist bdist_wheel
Anthonios Partheniou9f837642021-06-01 14:54:59 -040032twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*