build_artifacts.sh 1.3 KB

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