build_artifacts.sh 1.2 KB

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