build_artifacts.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. export BUILD_COMMIT=v$BUILD_VERSION
  8. export PLAT=x86_64
  9. export UNICODE_WIDTH=32
  10. export MACOSX_DEPLOYMENT_TARGET=10.9
  11. mkdir artifacts
  12. export ARTIFACT_DIR=$(pwd)/artifacts
  13. git clone https://github.com/matthew-brett/multibuild.git
  14. cp kokoro/release/python/linux/config.sh config.sh
  15. build_artifact_version() {
  16. MB_PYTHON_VERSION=$1
  17. # Clean up env
  18. rm -rf venv
  19. sudo rm -rf protobuf
  20. git clone https://github.com/google/protobuf.git
  21. source multibuild/common_utils.sh
  22. source multibuild/travis_steps.sh
  23. before_install
  24. clean_code $REPO_DIR $BUILD_COMMIT
  25. sed -i '/Wno-sign-compare/a \ \ \ \ \ \ \ \ extra_compile_args.append("-std=c++11")' $REPO_DIR/python/setup.py
  26. cat $REPO_DIR/python/setup.py
  27. pushd $REPO_DIR
  28. git cherry-pick 0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7
  29. popd
  30. build_wheel $REPO_DIR/python $PLAT
  31. mv wheelhouse/* $ARTIFACT_DIR
  32. }
  33. build_artifact_version 2.7
  34. build_artifact_version 3.4
  35. build_artifact_version 3.5
  36. build_artifact_version 3.6
  37. build_artifact_version 3.7