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 "'"` 17export BUILD_COMMIT=`git rev-parse HEAD` 18export PLAT=x86_64 19export UNICODE_WIDTH=32 20export MACOSX_DEPLOYMENT_TARGET=10.9 21export TRAVIS_OS_NAME="osx" 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/macos/config.sh config.sh 30 31OLD_PATH=$PATH 32 33build_artifact_version() { 34 MB_PYTHON_VERSION=$1 35 36 # Clean up env 37 rm -rf venv 38 sudo rm -rf $REPO_DIR 39 cp -R $STAGE_DIR $REPO_DIR 40 export PATH=$OLD_PATH 41 42 source multibuild/common_utils.sh 43 source multibuild/travis_steps.sh 44 before_install 45 46 clean_code $REPO_DIR $BUILD_COMMIT 47 48 build_wheel $REPO_DIR/python $PLAT 49 50 mv wheelhouse/* $ARTIFACT_DIR 51} 52 53build_artifact_version 2.7 54build_artifact_version 3.5 55build_artifact_version 3.6 56build_artifact_version 3.7 57