diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 9b5bcc34..92ab3036 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -20,14 +20,6 @@ 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 @@ -35,9 +27,6 @@ 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 diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 6e7d411f..8e509855 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -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/*