build_artifacts.sh 1.2 KB

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