Browse Source

Add kokoro build for python source package

Bo Yang 7 years ago
parent
commit
ae54cd9514
1 changed files with 21 additions and 0 deletions
  1. 21 0
      kokoro/release/python/linux/build_artifacts.sh

+ 21 - 0
kokoro/release/python/linux/build_artifacts.sh

@@ -43,3 +43,24 @@ build_artifact_version 2.7
 build_artifact_version 3.4
 build_artifact_version 3.4
 build_artifact_version 3.5
 build_artifact_version 3.5
 build_artifact_version 3.6
 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