blob: ee923e3d870b5edeb7193eeb0ba787790fef0703 [file] [log] [blame]
Jan Tattermusch2c084ee2016-06-28 16:54:17 -07001#!/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
31set -ex
32
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020033cd $(dirname $0)
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070034
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020035mkdir -p ../../artifacts/
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070036
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070037mkdir -p nativelibs/windows_x86 nativelibs/windows_x64 \
38 nativelibs/linux_x86 nativelibs/linux_x64 \
39 nativelibs/macosx_x86 nativelibs/macosx_x64
40
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020041mkdir -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 Tattermusch2c084ee2016-06-28 16:54:17 -070046cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true
47cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true
48cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true
49cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=linux/artifacts/* nativelibs/linux_x64 || true
50cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true
51cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true
52
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020053# Collect protoc artifacts built by the previous build step
54cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x86 || true
55cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x64 || true
56cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x86 || true
57cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x64 || true
58cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x86 || true
59cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x64 || true
60
Jan Tattermusch8b435212017-04-05 13:34:37 +020061dotnet restore Grpc.sln
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070062
Jan Tattermusch8b435212017-04-05 13:34:37 +020063# To be able to build, we also need to put grpc_csharp_ext to its normal location
64mkdir -p ../../libs/opt
65cp nativelibs/linux_x64/libgrpc_csharp_ext.so ../../libs/opt
66
67dotnet pack --configuration Release Grpc.Core --output ../../../artifacts
68dotnet pack --configuration Release Grpc.Core.Testing --output ../../../artifacts
69dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts
70dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts
71dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070072
David Garcia Quintas9e1acc02017-04-13 16:30:15 -070073nuget pack Grpc.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts
74nuget pack Grpc.Tools.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020075
76(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)