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