blob: e3f8463ee88b24be327e7b338c76b181077abee3 [file] [log] [blame]
Jan Tattermusch2c084ee2016-06-28 16:54:17 -07001#!/bin/bash
Jan Tattermusch7897ae92017-06-07 22:57:36 +02002# Copyright 2016 gRPC authors.
Jan Tattermusch2c084ee2016-06-28 16:54:17 -07003#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02004# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
Jan Tattermusch2c084ee2016-06-28 16:54:17 -07007#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02008# http://www.apache.org/licenses/LICENSE-2.0
Jan Tattermusch2c084ee2016-06-28 16:54:17 -07009#
Jan Tattermusch7897ae92017-06-07 22:57:36 +020010# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070015
16set -ex
17
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020018cd $(dirname $0)
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070019
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020020mkdir -p ../../artifacts/
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070021
Jan Tattermuschd71a6312017-04-21 17:33:40 +020022# Collect the artifacts built by the previous build step
23mkdir -p nativelibs
24cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/csharp_ext_* nativelibs || true
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070025
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020026# Collect protoc artifacts built by the previous build step
Jan Tattermuschd71a6312017-04-21 17:33:40 +020027mkdir -p protoc_plugins
28cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/protoc_* protoc_plugins || true
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020029
Jan Tattermusch8b435212017-04-05 13:34:37 +020030dotnet restore Grpc.sln
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070031
Jan Tattermusch8b435212017-04-05 13:34:37 +020032# To be able to build, we also need to put grpc_csharp_ext to its normal location
33mkdir -p ../../libs/opt
Jan Tattermuschd71a6312017-04-21 17:33:40 +020034cp nativelibs/csharp_ext_linux_x64/libgrpc_csharp_ext.so ../../libs/opt
Jan Tattermusch8b435212017-04-05 13:34:37 +020035
Jan Tattermusch905f4182017-05-23 22:34:14 +020036dotnet pack --configuration Release Grpc.Core --output ../../../artifacts
37dotnet pack --configuration Release Grpc.Core.Testing --output ../../../artifacts
38dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts
39dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts
40dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070041
Mehrdad Afshari9073ea02018-02-22 22:21:33 -080042nuget pack Grpc.nuspec -Version "1.11.0-dev" -OutputDirectory ../../artifacts
43nuget pack Grpc.Tools.nuspec -Version "1.11.0-dev" -OutputDirectory ../../artifacts
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020044
45(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)