blob: fb4138a4b2b42f7ef216fbee38c72ecf6b1358a5 [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
Jan Tattermusch5f3a4522018-03-13 11:04:51 +010024# Jenkins flow (deprecated)
Jan Tattermuschd71a6312017-04-21 17:33:40 +020025cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/csharp_ext_* nativelibs || true
Jan Tattermusch5f3a4522018-03-13 11:04:51 +010026# Kokoro flow
27cp -r $EXTERNAL_GIT_ROOT/input_artifacts/csharp_ext_* nativelibs || true
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070028
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020029# Collect protoc artifacts built by the previous build step
Jan Tattermuschd71a6312017-04-21 17:33:40 +020030mkdir -p protoc_plugins
Jan Tattermusch5f3a4522018-03-13 11:04:51 +010031# Jenkins flow (deprecated)
Jan Tattermuschd71a6312017-04-21 17:33:40 +020032cp -r $EXTERNAL_GIT_ROOT/platform={windows,linux,macos}/artifacts/protoc_* protoc_plugins || true
Jan Tattermusch5f3a4522018-03-13 11:04:51 +010033# Kokoro flow
34cp -r $EXTERNAL_GIT_ROOT/input_artifacts/protoc_* protoc_plugins || true
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020035
Jan Tattermusch8b435212017-04-05 13:34:37 +020036dotnet restore Grpc.sln
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070037
Jan Tattermusch8b435212017-04-05 13:34:37 +020038# To be able to build, we also need to put grpc_csharp_ext to its normal location
39mkdir -p ../../libs/opt
Jan Tattermuschd71a6312017-04-21 17:33:40 +020040cp nativelibs/csharp_ext_linux_x64/libgrpc_csharp_ext.so ../../libs/opt
Jan Tattermusch8b435212017-04-05 13:34:37 +020041
Jan Tattermusch905f4182017-05-23 22:34:14 +020042dotnet pack --configuration Release Grpc.Core --output ../../../artifacts
43dotnet pack --configuration Release Grpc.Core.Testing --output ../../../artifacts
44dotnet pack --configuration Release Grpc.Auth --output ../../../artifacts
45dotnet pack --configuration Release Grpc.HealthCheck --output ../../../artifacts
46dotnet pack --configuration Release Grpc.Reflection --output ../../../artifacts
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070047
Mehrdad Afshari2d43a452018-05-02 22:49:52 -070048nuget pack Grpc.nuspec -Version "1.13.0-dev" -OutputDirectory ../../artifacts
Jan Tattermusch890717b2018-06-07 11:18:14 +020049nuget pack Grpc.Core.NativeDebug.nuspec -Version "1.13.0-dev" -OutputDirectory ../../artifacts
Mehrdad Afshari2d43a452018-05-02 22:49:52 -070050nuget pack Grpc.Tools.nuspec -Version "1.13.0-dev" -OutputDirectory ../../artifacts
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020051
52(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)