build_artifacts.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. set -ex
  3. # change to repo root
  4. pushd $(dirname $0)/../../../..
  5. export REPO_DIR=protobuf
  6. export BUILD_VERSION=`grep -i "version" python/google/protobuf/__init__.py | grep -o "'.*'" | tr -d "'"`
  7. if [ -z $KOKORO_JOB_NAME ]; then
  8. export BUILD_COMMIT=master
  9. else
  10. export BUILD_COMMIT=`echo "$KOKORO_JOB_NAME" | cut -d '/' -f 3`
  11. fi
  12. export PLAT=x86_64
  13. export UNICODE_WIDTH=32
  14. export MACOSX_DEPLOYMENT_TARGET=10.9
  15. rm -rf artifacts/
  16. rm -rf multibuild/
  17. mkdir artifacts
  18. export ARTIFACT_DIR=$(pwd)/artifacts
  19. git clone https://github.com/matthew-brett/multibuild.git
  20. cp kokoro/release/python/linux/config.sh config.sh
  21. build_artifact_version() {
  22. MB_PYTHON_VERSION=$1
  23. # Clean up env
  24. rm -rf venv
  25. sudo rm -rf protobuf
  26. git clone https://github.com/google/protobuf.git
  27. source multibuild/common_utils.sh
  28. source multibuild/travis_steps.sh
  29. before_install
  30. clean_code $REPO_DIR $BUILD_COMMIT
  31. sed -i '/Wno-sign-compare/a \ \ \ \ \ \ \ \ extra_compile_args.append("-std=c++11")' $REPO_DIR/python/setup.py
  32. cat $REPO_DIR/python/setup.py
  33. build_wheel $REPO_DIR/python $PLAT
  34. mv wheelhouse/* $ARTIFACT_DIR
  35. }
  36. build_artifact_version 2.7
  37. build_artifact_version 3.4
  38. build_artifact_version 3.5
  39. build_artifact_version 3.6
  40. build_artifact_version 3.7