Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Jun 6, 2024
1 parent 1051786 commit 458c721
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 74 deletions.
27 changes: 0 additions & 27 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,13 @@ if [[ -z "${PROJECT_ROOT:-}" ]]; then
fi

cd "${PROJECT_ROOT}"
# Need enchant for spell check
sudo apt-get update
sudo apt-get -y install dictionaries-common aspell aspell-en \
hunspell-en-us libenchant1c2a enchant

set -eo pipefail

cd github/python-crc32c

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1

# Debug: show build environment
env | grep KOKORO

# Setup firestore account credentials
export FIRESTORE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/firebase-credentials.json

# Setup service account credentials.
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json

Expand Down Expand Up @@ -68,19 +57,3 @@ if [[ -n "${NOX_SESSION:-}" ]]; then
else
python3 -m nox
fi
# Find out if this package was modified.
# Temporarily use Thea's fork of ci-diff-helper w/ Kokoro support.
# python3.6 -m pip install --quiet git+https://github.com/theacodes/ci-diff-helper.git
# python3.6 test_utils/scripts/get_target_packages_kokoro.py > ~/target_packages
# cat ~/target_packages

# if [[ ! -n $(grep -x "$PACKAGE" ~/target_packages) ]]; then
# echo "$PACKAGE was not modified, returning."
# exit;
# fi

# cd "$PACKAGE"

# Some system tests require indexes. Use gcloud to create them.
gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS --project=$PROJECT_ID
#gcloud --quiet --verbosity=debug datastore indexes create tests/system/index.yaml
51 changes: 4 additions & 47 deletions .kokoro/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,59 +14,16 @@
# limitations under the License.

set -eo pipefail
echo "Release script started"

if [ "$(uname)" == "Darwin" ]; then
# Mac OS
PYTHON=$(PYENV_VERSION=3.9 pyenv which python)
PYTHON_BIN=$(dirname ${PYTHON})

RELEASETOOL=${PYTHON_BIN}/releasetool
TWINE=${PYTHON_BIN}/twine
${PYTHON} -m pip install gcp-releasetool twine --user

echo "Change to code directory"
REPO_ROOT=$(pwd)
cd "${REPO_ROOT}"
ls

else
# Kokoro Linux
mv /keys/73713_google-cloud-pypi-token-keystore-1 /73713_google-cloud-pypi-token-keystore-1

PATH=/opt/python/cp39-cp39/bin/:$PATH
PYTHON_BIN=/opt/python/cp39-cp39/bin/
RELEASETOOL=${PYTHON_BIN}/releasetool
PYTHON=${PYTHON_BIN}/python
TWINE=${PYTHON_BIN}/twine
${PYTHON} -m pip install gcp-releasetool twine

echo "Change to code directory"
REPO_ROOT=/var/code/python-crc32c/
cd "${REPO_ROOT}"
ls

fi

echo "Download dependencies for release script"

# Start the releasetool reporter
${PYTHON} -m pip install --require-hashes -r ${REPO_ROOT}/.kokoro/requirements.txt
${RELEASETOOL} publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script

# Ensure that we have the latest versions of Twine, Wheel, and Setuptools.
${PYTHON} -m pip install --upgrade twine wheel setuptools --user
python3 -m pip install --require-hashes -r github/python-crc32c/.kokoro/requirements.txt
python3 -m releasetool publish-reporter-script > /tmp/publisher-script; source /tmp/publisher-script

# Disable buffering, so that the logs stream through.
export PYTHONUNBUFFERED=1
echo "## RELASE WORKFLOW SUCCESSFUL ##"
echo "## Uploading Wheels ##"
# TODO: ONE OF THE BELOW WORKS

# Move into the package, build the distribution and upload.
TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1")
cd github/python-crc32c
python3 setup.py sdist bdist_wheel
#twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*

${PYTHON} setup.py sdist
# ${TWINE} upload --skip-existing --username gcloudpypi --password "${TWINE_PASSWORD}" dist/* wheels/*
twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/*

0 comments on commit 458c721

Please sign in to comment.