blob: 2807278de6d7bc3f6d879f6b5707208b7c33527b [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
37# IMPORTANT: NuGet packages generated by dotnet CLI are considered experimental.
38# The official nugets are generated by src/csharp/build_packages.bat
39
40mkdir -p nativelibs/windows_x86 nativelibs/windows_x64 \
41 nativelibs/linux_x86 nativelibs/linux_x64 \
42 nativelibs/macosx_x86 nativelibs/macosx_x64
43
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020044mkdir -p protoc_plugins/windows_x86 protoc_plugins/windows_x64 \
45 protoc_plugins/linux_x86 protoc_plugins/linux_x64 \
46 protoc_plugins/macosx_x86 protoc_plugins/macosx_x64
47
48# Collect the artifacts built by the previous build step if running on Jenkins
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070049cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=windows/artifacts/* nativelibs/windows_x86 || true
50cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=windows/artifacts/* nativelibs/windows_x64 || true
51cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=linux/artifacts/* nativelibs/linux_x86 || true
52cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=linux/artifacts/* nativelibs/linux_x64 || true
53cp $EXTERNAL_GIT_ROOT/architecture=x86,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x86 || true
54cp $EXTERNAL_GIT_ROOT/architecture=x64,language=csharp,platform=macos/artifacts/* nativelibs/macosx_x64 || true
55
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020056# Collect protoc artifacts built by the previous build step
57cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x86 || true
58cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=windows/artifacts/* protoc_plugins/windows_x64 || true
59cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x86 || true
60cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=linux/artifacts/* protoc_plugins/linux_x64 || true
61cp $EXTERNAL_GIT_ROOT/architecture=x86,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x86 || true
62cp $EXTERNAL_GIT_ROOT/architecture=x64,language=protoc,platform=macos/artifacts/* protoc_plugins/macosx_x64 || true
63
Jan Tattermusch2c084ee2016-06-28 16:54:17 -070064dotnet restore .
65
66dotnet pack --configuration Release Grpc.Core/project.json --output ../../artifacts
67dotnet pack --configuration Release Grpc.Auth/project.json --output ../../artifacts
68dotnet pack --configuration Release Grpc.HealthCheck/project.json --output ../../artifacts
69
Jan Tattermusch8a84c8c2016-09-08 21:06:10 +020070nuget pack Grpc.nuspec -Version "1.1.0-dev" -OutputDirectory ../../artifacts
71nuget pack Grpc.Tools.nuspec -Version "1.1.0-dev" -OutputDirectory ../../artifacts
72
73(cd ../../artifacts && zip csharp_nugets_dotnetcli.zip *.nupkg)