blob: 4036629d881c6c0aa414a810ff76baf6119d4b8a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
#!/bin/bash
set -ex
# change to repo root
pushd $(dirname $0)/../../../..
export REPO_DIR=protobuf
export BUILD_VERSION=`grep -i "version" python/google/protobuf/__init__.py | grep -o "'.*'" | tr -d "'"`
export BUILD_COMMIT=v$BUILD_VERSION
export PLAT=x86_64
export UNICODE_WIDTH=32
export MACOSX_DEPLOYMENT_TARGET=10.9
mkdir artifacts
export ARTIFACT_DIR=$(pwd)/artifacts
git clone https://github.com/matthew-brett/multibuild.git
cp kokoro/release/python/linux/config.sh config.sh
build_artifact_version() {
MB_PYTHON_VERSION=$1
# Clean up env
rm -rf venv
sudo rm -rf protobuf
git clone https://github.com/google/protobuf.git
source multibuild/common_utils.sh
source multibuild/travis_steps.sh
before_install
clean_code $REPO_DIR $BUILD_COMMIT
sed -i '/Wno-sign-compare/a \ \ \ \ \ \ \ \ extra_compile_args.append("-std=c++11")' $REPO_DIR/python/setup.py
cat $REPO_DIR/python/setup.py
build_wheel $REPO_DIR/python $PLAT
mv wheelhouse/* $ARTIFACT_DIR
}
build_artifact_version 2.7
build_artifact_version 3.4
build_artifact_version 3.5
build_artifact_version 3.6
# Build source package
# Clean up env
rm -rf venv
sudo rm -rf protobuf
git clone https://github.com/google/protobuf.git
cd protobuf
git checkout $BUILD_COMMIT
# Make sure all files are world-readable.
find python -type d -exec chmod a+r,a+x {} +
find python -type f -exec chmod a+r {} +
umask 0022
cd python
# Be sure to run build before sdist, because otherwise sdist will not include
# well-known types.
python setup.py clean build sdist
ls
|