build_artifacts.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. export TRAVIS_OS_NAME="osx"
  12. mkdir artifacts
  13. export ARTIFACT_DIR=$(pwd)/artifacts
  14. git clone https://github.com/matthew-brett/multibuild.git
  15. cp kokoro/release/python/linux/config.sh config.sh
  16. OLD_PATH=$PATH
  17. build_artifact_version() {
  18. MB_PYTHON_VERSION=$1
  19. # Clean up env
  20. rm -rf venv
  21. sudo rm -rf protobuf
  22. git clone https://github.com/google/protobuf.git
  23. export PATH=$OLD_PATH
  24. source multibuild/common_utils.sh
  25. source multibuild/travis_steps.sh
  26. before_install
  27. clean_code $REPO_DIR $BUILD_COMMIT
  28. pushd $REPO_DIR
  29. git cherry-pick 0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7
  30. popd
  31. build_wheel $REPO_DIR/python $PLAT
  32. mv wheelhouse/* $ARTIFACT_DIR
  33. }
  34. build_artifact_version 2.7
  35. build_artifact_version 3.4
  36. build_artifact_version 3.5
  37. build_artifact_version 3.6
  38. build_artifact_version 3.7