build_artifacts.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. build_wheel $REPO_DIR/python $PLAT
  31. mv wheelhouse/* $ARTIFACT_DIR
  32. # Clean up env
  33. rm -rf venv
  34. sudo rm -rf $REPO_DIR
  35. }
  36. build_crosscompiled_aarch64_artifact_version() {
  37. # crosscompilation is only supported with the dockcross manylinux2014 image
  38. DOCKER_IMAGE=dockcross/manylinux2014-aarch64:20210706-65bf2dd
  39. PLAT=aarch64
  40. # TODO(jtatermusch): currently when crosscompiling, "auditwheel repair" will be disabled
  41. # since auditwheel doesn't work for crosscomiled wheels.
  42. build_artifact_version $@
  43. }
  44. build_artifact_version 3.6
  45. build_artifact_version 3.7
  46. build_artifact_version 3.8
  47. build_artifact_version 3.9
  48. build_artifact_version 3.10
  49. build_crosscompiled_aarch64_artifact_version 3.7
  50. build_crosscompiled_aarch64_artifact_version 3.8
  51. build_crosscompiled_aarch64_artifact_version 3.9
  52. build_crosscompiled_aarch64_artifact_version 3.10