#!/bin/bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
set -e
set -x

source tensorflow/tools/ci_build/release/common.sh

sudo pip install --upgrade twine

# Copy and rename to tf_nightly
for f in $(ls "${KOKORO_GFILE_DIR}"/tf_nightly_gpu*dev*cp3*-cp3*-win_amd64.whl); do
  copy_to_new_project_name "${f}" tf_nightly python
done

# Upload the built packages to pypi.
for f in $(ls "${KOKORO_GFILE_DIR}"/tf_nightly*dev*cp3*-cp3*-win_amd64.whl); do
  twine upload -r pypi-warehouse "$f" || echo
done

#!/bin/bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
set -e
set -x

source tensorflow/tools/ci_build/release/common.sh

python -m pip install --upgrade twine

# Copy and rename to tf_nightly
for f in $(ls "${KOKORO_GFILE_DIR}"/tf_nightly_gpu*dev*cp3*-cp3*-win_amd64.whl); do
  copy_to_new_project_name "${f}" tf_nightly python
done

# Upload the built packages to pypi.
for f in $(ls "${KOKORO_GFILE_DIR}"/tf_nightly*dev*cp3*-cp3*-win_amd64.whl); do
  twine upload -r pypi-warehouse "$f" || echo
done

Install `twine` in the current python home, not as root.
Install `twine` in the current python home, not as root.

This allows us to use a newer version of `twine` which has support for both `pack` and `unpack` (why would it even only support one of them?).

```
+ python -m wheel pack .
usage: __main__.py [-h]
                   {keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
                   ...
__main__.py: error: invalid choice: 'pack' (choose from 'keygen', 'sign', 'unsign', 'verify', 'unpack', 'install', 'install-scripts', 'convert', 'version', 'help')
```
PiperOrigin-RevId: 342661303
Change-Id: I78278689720054dd3c8684314d7d9f121fa6f986
