소스 검색

Python wheel kokoro for mac (#5017)

* Add config for building python wheel on mac

* Specify os name

* Clean up venv

* Debug

* Recover old path
Paul Yang 7 년 전
부모
커밋
af3b2ab915
2개의 변경된 파일55개의 추가작업 그리고 0개의 파일을 삭제
  1. 47 0
      kokoro/release/python/macos/build_artifacts.sh
  2. 8 0
      kokoro/release/python/macos/release.cfg

+ 47 - 0
kokoro/release/python/macos/build_artifacts.sh

@@ -0,0 +1,47 @@
+#!/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
+export TRAVIS_OS_NAME="osx"
+
+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
+
+OLD_PATH=$PATH
+
+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
+  export PATH=$OLD_PATH
+
+  source multibuild/common_utils.sh
+  source multibuild/travis_steps.sh
+  before_install
+
+  clean_code $REPO_DIR $BUILD_COMMIT
+
+  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

+ 8 - 0
kokoro/release/python/macos/release.cfg

@@ -0,0 +1,8 @@
+# Configuration for Mac OSX release builds
+build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh"
+
+action {
+  define_artifacts {
+    regex: "github/protobuf/artifacts/**"
+  }
+}