commit
d6f346b4d5
59 changed files with 628 additions and 93 deletions
@ -0,0 +1,14 @@ |
||||
#!/bin/bash |
||||
|
||||
set -ex |
||||
|
||||
# change to repo root |
||||
cd $(dirname $0)/../../.. |
||||
|
||||
source kokoro/release/linux/prepare_build.sh |
||||
|
||||
# ruby environment |
||||
source kokoro/release/linux/ruby/ruby_build_environment.sh |
||||
|
||||
# build artifacts |
||||
bash kokoro/release/linux/ruby/ruby_build.sh |
@ -0,0 +1,16 @@ |
||||
#!/bin/bash |
||||
|
||||
# Move docker's storage location to scratch disk so we don't run out of space. |
||||
echo 'DOCKER_OPTS="${DOCKER_OPTS} --graph=/tmpfs/docker"' | sudo tee --append /etc/default/docker |
||||
# Use container registry mirror for pulling docker images (should make downloads faster) |
||||
# See https://cloud.google.com/container-registry/docs/using-dockerhub-mirroring |
||||
echo 'DOCKER_OPTS="${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io"' | sudo tee --append /etc/default/docker |
||||
sudo service docker restart |
||||
|
||||
# Download Docker images from DockerHub |
||||
export DOCKERHUB_ORGANIZATION=grpctesting |
||||
|
||||
# All artifacts come here |
||||
mkdir artifacts |
||||
export ARTIFACT_DIR=$(pwd)/artifacts |
||||
|
@ -0,0 +1,8 @@ |
||||
# Configuration for Linux release builds |
||||
build_file: "protobuf/kokoro/release/linux/build_artifacts.sh" |
||||
|
||||
action { |
||||
define_artifacts { |
||||
regex: "github/protobuf/artifacts/**" |
||||
} |
||||
} |
@ -0,0 +1,15 @@ |
||||
#!/bin/bash |
||||
|
||||
# Build protoc |
||||
if test ! -e src/protoc; then |
||||
./autogen.sh |
||||
./configure |
||||
make -j4 |
||||
fi |
||||
|
||||
umask 0022 |
||||
pushd ruby |
||||
bundle install && bundle exec rake gem:native |
||||
ls pkg |
||||
mv pkg/* $ARTIFACT_DIR |
||||
popd |
@ -0,0 +1,8 @@ |
||||
#!/bin/bash |
||||
|
||||
set +ex |
||||
[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh |
||||
set -e # rvm commands are very verbose |
||||
rvm --default use ruby-2.4.1 |
||||
gem install bundler --update |
||||
set -ex |
@ -0,0 +1,19 @@ |
||||
#!/bin/bash |
||||
|
||||
set -ex |
||||
|
||||
# change to repo root |
||||
cd $(dirname $0)/../../.. |
||||
|
||||
# all artifacts come here |
||||
mkdir artifacts |
||||
export ARTIFACT_DIR=$(pwd)/artifacts |
||||
|
||||
# ruby environment |
||||
bash kokoro/release/macos/ruby/ruby_build_environment.sh |
||||
|
||||
gem install rubygems-update |
||||
update_rubygems |
||||
|
||||
# build artifacts |
||||
bash kokoro/release/macos/ruby/ruby_build.sh |
@ -0,0 +1,8 @@ |
||||
# Configuration for Mac OSX release builds |
||||
build_file: "protobuf/kokoro/release/macos/build_artifacts.sh" |
||||
|
||||
action { |
||||
define_artifacts { |
||||
regex: "github/protobuf/artifacts/**" |
||||
} |
||||
} |
@ -0,0 +1,15 @@ |
||||
#!/bin/bash |
||||
|
||||
# Build protoc |
||||
if test ! -e src/protoc; then |
||||
./autogen.sh |
||||
./configure |
||||
make -j4 |
||||
fi |
||||
|
||||
umask 0022 |
||||
pushd ruby |
||||
bundle install && bundle exec rake gem:native |
||||
ls pkg |
||||
mv pkg/* $ARTIFACT_DIR |
||||
popd |
@ -0,0 +1,57 @@ |
||||
#!/bin/bash |
||||
|
||||
set -ex |
||||
|
||||
set +ex # rvm script is very verbose and exits with errorcode |
||||
source $HOME/.rvm/scripts/rvm |
||||
set -e # rvm commands are very verbose |
||||
time rvm install 2.5.0 |
||||
rvm use 2.5.0 --default |
||||
gem install rake-compiler --no-ri --no-doc |
||||
gem install bundler --no-ri --no-doc |
||||
rvm osx-ssl-certs status all |
||||
rvm osx-ssl-certs update all |
||||
set -ex |
||||
|
||||
rm -rf ~/.rake-compiler |
||||
|
||||
CROSS_RUBY=$(mktemp tmpfile.XXXXXXXX) |
||||
|
||||
curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v1.0.3/tasks/bin/cross-ruby.rake > "$CROSS_RUBY" |
||||
|
||||
# See https://github.com/grpc/grpc/issues/12161 for verconf.h patch details |
||||
patch "$CROSS_RUBY" << EOF |
||||
--- cross-ruby.rake 2018-04-10 11:32:16.000000000 -0700 |
||||
+++ patched 2018-04-10 11:40:25.000000000 -0700 |
||||
@@ -133,8 +133,10 @@ |
||||
"--host=#{MINGW_HOST}", |
||||
"--target=#{MINGW_TARGET}", |
||||
"--build=#{RUBY_BUILD}", |
||||
- '--enable-shared', |
||||
+ '--enable-static', |
||||
+ '--disable-shared', |
||||
'--disable-install-doc', |
||||
+ '--without-gmp', |
||||
'--with-ext=' |
||||
] |
||||
|
||||
@@ -151,6 +153,7 @@ |
||||
# make |
||||
file "#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}/ruby.exe" => ["#{USER_HOME}/builds/#{MINGW_HOST}/#{RUBY_CC_VERSION}/Makefile"] do |t| |
||||
chdir File.dirname(t.prerequisites.first) do |
||||
+ sh "test -s verconf.h || rm -f verconf.h" # if verconf.h has size 0, make sure it gets re-built by make |
||||
sh MAKE |
||||
end |
||||
end |
||||
EOF |
||||
|
||||
MAKE="make -j8" |
||||
|
||||
for v in 2.5.0 2.4.0 2.3.0 2.2.2 2.1.6 2.0.0-p645 ; do |
||||
ccache -c |
||||
rake -f "$CROSS_RUBY" cross-ruby VERSION="$v" HOST=x86_64-darwin11 MAKE="$MAKE" |
||||
done |
||||
|
||||
sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > "$CROSS_RUBY" |
||||
mv "$CROSS_RUBY" ~/.rake-compiler/config.yml |
||||
|
@ -0,0 +1,23 @@ |
||||
#!/bin/bash |
||||
|
||||
set -x |
||||
CXXFLAGS_COMMON="-DNDEBUG -mmacosx-version-min=10.9" |
||||
|
||||
cd github/protobuf |
||||
./autogen.sh |
||||
|
||||
mkdir build32 && cd build32 |
||||
export CXXFLAGS="$CXXFLAGS_COMMON -m32" |
||||
../configure --disable-shared |
||||
make -j4 |
||||
file src/protoc |
||||
otool -L src/protoc | grep dylib |
||||
cd .. |
||||
|
||||
mkdir build64 && cd build64 |
||||
export CXXFLAGS="$CXXFLAGS_COMMON -m64" |
||||
../configure --disable-shared |
||||
make -j4 |
||||
file src/protoc |
||||
otool -L src/protoc | grep dylib |
||||
cd .. |
@ -0,0 +1,8 @@ |
||||
# Configuration for Mac OSX protoc release builds |
||||
build_file: "protobuf/kokoro/release/protoc/macos/build.sh" |
||||
|
||||
action { |
||||
define_artifacts { |
||||
regex: "**/protoc" |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
set PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH% |
||||
set generator32=Visual Studio 14 |
||||
set generator64=Visual Studio 14 Win64 |
||||
set vcplatform32=win32 |
||||
set vcplatform64=x64 |
||||
set configuration=Release |
||||
|
||||
echo Building protoc |
||||
cd github\protobuf |
||||
|
||||
mkdir build32 |
||||
cd build32 |
||||
cmake -G "%generator32%" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_UNICODE=ON ../cmake |
||||
msbuild protobuf.sln /p:Platform=%vcplatform32% || goto error |
||||
cd .. |
||||
|
||||
mkdir build64 |
||||
cd build64 |
||||
cmake -G "%generator64%" -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_UNICODE=ON ../cmake |
||||
msbuild protobuf.sln /p:Platform=%vcplatform64% || goto error |
||||
cd .. |
||||
|
||||
goto :EOF |
||||
|
||||
:error |
||||
echo Failed! |
||||
exit /b %ERRORLEVEL% |
@ -0,0 +1,8 @@ |
||||
# Configuration for Windows protoc release builds |
||||
build_file: "protobuf/kokoro/release/protoc/windows/build.bat" |
||||
|
||||
action { |
||||
define_artifacts { |
||||
regex: "**/protoc.exe" |
||||
} |
||||
} |
Loading…
Reference in new issue