Jan Tattermusch | 2c084ee | 2016-06-28 16:54:17 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright 2016, Google Inc. |
| 3 | # All rights reserved. |
| 4 | # |
| 5 | # Redistribution and use in source and binary forms, with or without |
| 6 | # modification, are permitted provided that the following conditions are |
| 7 | # met: |
| 8 | # |
| 9 | # * Redistributions of source code must retain the above copyright |
| 10 | # notice, this list of conditions and the following disclaimer. |
| 11 | # * Redistributions in binary form must reproduce the above |
| 12 | # copyright notice, this list of conditions and the following disclaimer |
| 13 | # in the documentation and/or other materials provided with the |
| 14 | # distribution. |
| 15 | # * Neither the name of Google Inc. nor the names of its |
| 16 | # contributors may be used to endorse or promote products derived from |
| 17 | # this software without specific prior written permission. |
| 18 | # |
| 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | |
| 31 | set -ex |
| 32 | |
Jan Tattermusch | 8a84c8c | 2016-09-08 21:06:10 +0200 | [diff] [blame] | 33 | cd $(dirname $0) |
Jan Tattermusch | 2c084ee | 2016-06-28 16:54:17 -0700 | [diff] [blame] | 34 | |
Jan Tattermusch | 8a84c8c | 2016-09-08 21:06:10 +0200 | [diff] [blame] | 35 | mkdir -p ../../artifacts/ |
Jan Tattermusch | 2c084ee | 2016-06-28 16:54:17 -0700 | [diff] [blame] | 36 | |
Jan Tattermusch | 2c084ee | 2016-06-28 16:54:17 -0700 | [diff] [blame] | 37 | mkdir -p nativelibs/windows_x86 nativelibs/windows_x64 \ |
| 38 | nativelibs/linux_x86 nativelibs/linux_x64 \ |
| 39 | nativelibs/macosx_x86 nativelibs/macosx_x64 |
| 40 | |
Jan Tattermusch | 8a84c8c | 2016-09-08 21:06:10 +0200 | [diff] [blame] | 41 | mkdir -p protoc_plugins/windows_x86 protoc_plugins/windows_x64 \ |
| 42 | protoc_plugins/linux_x86 protoc_plugins/linux_x64 \ |
| 43 | protoc_plugins/macosx_x86 protoc_plugins/macosx_x64 |
| 44 | |
| 45 | # Collect the artifacts built by the previous build step if running on Jenkins |
Jan Tattermusch | 2c084ee | 2016-06-28 16:54:17 -0700 | [diff] [blame] | 46 | cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true |
| 47 | cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true |
| 48 | cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true |
| 49 | cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=linux/artifacts/* nativelibs/linux_x64 || true |
| 50 | cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true |
| 51 | cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true |
| 52 | |
Jan Tattermusch | 8a84c8c | 2016-09-08 21:06:10 +0200 | [diff] [blame] | 53 | # Collect protoc artifacts built by the previous build step |
| 54 | cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x86 || true |
| 55 | cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x64 || true |
| 56 | cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x86 || true |
| 57 | cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x64 || true |
| 58 | cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x86 || true |
| 59 | cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x64 || true |
| 60 | |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 61 | dotnet restore Grpc.sln |
Jan Tattermusch | 2c084ee | 2016-06-28 16:54:17 -0700 | [diff] [blame] | 62 | |
Jan Tattermusch | 8b43521 | 2017-04-05 13:34:37 +0200 | [diff] [blame] | 63 | # To be able to build, we also need to put grpc_csharp_ext to its normal location |
| 64 | mkdir -p ../../libs/opt |
| 65 | cp nativelibs/linux_x64/libgrpc_csharp_ext.so ../../libs/opt |
| 66 | |
| 67 | dotnet pack --configuration Release Grpc.Core --output ../../../artifacts |
| 68 | dotnet pack --configuration Release Grpc.Core.Testing --output ../../../artifacts |
| 69 | dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts |
| 70 | dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts |
| 71 | dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts |
Jan Tattermusch | 2c084ee | 2016-06-28 16:54:17 -0700 | [diff] [blame] | 72 | |
David Garcia Quintas | 9e1acc0 | 2017-04-13 16:30:15 -0700 | [diff] [blame] | 73 | nuget pack Grpc.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts |
| 74 | nuget pack Grpc.Tools.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts |
Jan Tattermusch | 8a84c8c | 2016-09-08 21:06:10 +0200 | [diff] [blame] | 75 | |
| 76 | (cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg) |