Skip to content

Commit

Permalink
Add a release script for Trax.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 282108850
  • Loading branch information
afrozenator authored and copybara-github committed Nov 23, 2019
1 parent 59b21ca commit cdb7b53
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions oss_scripts/oss_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2019 The Trax Authors.
#
# 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.

#!/bin/bash

set -v # print commands as they're executed
set -e # fail and exit on any command erroring

GIT_COMMIT_ID=${1:-""}
[[ -z $GIT_COMMIT_ID ]] && echo "Must provide a commit" && exit 1

TMP_DIR=$(mktemp -d)
pushd $TMP_DIR

echo "Cloning trax and checking out commit $GIT_COMMIT_ID"
git clone https://github.com/google/trax.git
cd trax
git checkout $GIT_COMMIT_ID

pip install wheel twine pyopenssl

# Build the distribution
echo "Building distribution"
python setup.py sdist
python setup.py bdist_wheel --universal

# Publish to PyPI
echo "Publishing to PyPI"
twine upload dist/*

# Cleanup
rm -rf build/ dist/ trax.egg-info/
popd
rm -rf $TMP_DIR

0 comments on commit cdb7b53

Please sign in to comment.