build_artifacts.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. build_wheel $REPO_DIR/python $PLAT
  28. mv wheelhouse/* $ARTIFACT_DIR
  29. }
  30. build_artifact_version 2.7
  31. build_artifact_version 3.4
  32. build_artifact_version 3.5
  33. build_artifact_version 3.6
  34. build_artifact_version 3.7