blob: d33923845c161848051cd76b6ed5419ef07f9ce3 [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 Tattermuschd71a6312017-04-21 17:33:40 +020037# Collect the artifacts built by the previous build step
38mkdir -p nativelibs
39cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/csharp_ext_* nativelibs || true
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070040
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020041# Collect protoc artifacts built by the previous build step
Jan Tattermuschd71a6312017-04-21 17:33:40 +020042mkdir -p protoc_plugins
43cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/protoc_* protoc_plugins || true
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020044
Jan Tattermusch8b435212017-04-05 13:34:37 +020045dotnet restore Grpc.sln
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070046
Jan Tattermusch8b435212017-04-05 13:34:37 +020047# To be able to build, we also need to put grpc_csharp_ext to its normal location
48mkdir -p ../../libs/opt
Jan Tattermuschd71a6312017-04-21 17:33:40 +020049cp nativelibs/csharp_ext_linux_x64/libgrpc_csharp_ext.so ../../libs/opt
Jan Tattermusch8b435212017-04-05 13:34:37 +020050
51dotnet pack --configuration Release Grpc.Core --output ../../../artifacts
52dotnet pack --configuration Release Grpc.Core.Testing --output ../../../artifacts
53dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts
54dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts
55dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070056
David Garcia Quintas9e1acc02017-04-13 16:30:15 -070057nuget pack Grpc.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts
58nuget pack Grpc.Tools.nuspec -Version "1.4.0-dev" -OutputDirectory ../../artifacts
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020059
60(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)