blob: 4087d8b67a66745525dcedbd951351fe946ef9c3 [file] [log] [blame]
Jan Tattermusch7897ae92017-06-07 22:57:36 +02001@rem Copyright 2016 gRPC authors.
Alexander Polcyn84be2652016-10-27 23:52:16 -07002@rem
Jan Tattermusch7897ae92017-06-07 22:57:36 +02003@rem Licensed under the Apache License, Version 2.0 (the "License");
4@rem you may not use this file except in compliance with the License.
5@rem You may obtain a copy of the License at
Alexander Polcyn84be2652016-10-27 23:52:16 -07006@rem
Jan Tattermusch7897ae92017-06-07 22:57:36 +02007@rem http://www.apache.org/licenses/LICENSE-2.0
Alexander Polcyn84be2652016-10-27 23:52:16 -07008@rem
Jan Tattermusch7897ae92017-06-07 22:57:36 +02009@rem Unless required by applicable law or agreed to in writing, software
10@rem distributed under the License is distributed on an "AS IS" BASIS,
11@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12@rem See the License for the specific language governing permissions and
13@rem limitations under the License.
Alexander Polcyn84be2652016-10-27 23:52:16 -070014
15@rem Current package versions
Mehrdad Afshari43884042018-01-19 14:25:15 -080016set VERSION=1.10.0-dev
Alexander Polcyn84be2652016-10-27 23:52:16 -070017
18@rem Adjust the location of nuget.exe
19set NUGET=C:\nuget\nuget.exe
Jan Tattermusch8b435212017-04-05 13:34:37 +020020set DOTNET=dotnet
Alexander Polcyn84be2652016-10-27 23:52:16 -070021
22set -ex
23
Jan Tattermuschd71a6312017-04-21 17:33:40 +020024mkdir ..\..\artifacts
Alexander Polcyn84be2652016-10-27 23:52:16 -070025
26@rem Collect the artifacts built by the previous build step if running on Jenkins
Jan Tattermuschd71a6312017-04-21 17:33:40 +020027mkdir nativelibs
28powershell -Command "cp -r ..\..\platform=*\artifacts\csharp_ext_* nativelibs"
Alexander Polcyn84be2652016-10-27 23:52:16 -070029
30@rem Collect protoc artifacts built by the previous build step
Jan Tattermuschd71a6312017-04-21 17:33:40 +020031mkdir protoc_plugins
32powershell -Command "cp -r ..\..\platform=*\artifacts\protoc_* protoc_plugins"
Alexander Polcyn84be2652016-10-27 23:52:16 -070033
Jan Tattermusch8b435212017-04-05 13:34:37 +020034%DOTNET% restore Grpc.sln || goto :error
Alexander Polcyn84be2652016-10-27 23:52:16 -070035
Jan Tattermusch8b435212017-04-05 13:34:37 +020036@rem To be able to build, we also need to put grpc_csharp_ext to its normal location
Jan Tattermuschd71a6312017-04-21 17:33:40 +020037xcopy /Y /I nativelibs\csharp_ext_windows_x64\grpc_csharp_ext.dll ..\..\cmake\build\x64\Release\
Jan Tattermusch8b435212017-04-05 13:34:37 +020038
Jan Tattermusch905f4182017-05-23 22:34:14 +020039%DOTNET% pack --configuration Release Grpc.Core --output ..\..\..\artifacts || goto :error
40%DOTNET% pack --configuration Release Grpc.Core.Testing --output ..\..\..\artifacts || goto :error
41%DOTNET% pack --configuration Release Grpc.Auth --output ..\..\..\artifacts || goto :error
42%DOTNET% pack --configuration Release Grpc.HealthCheck --output ..\..\..\artifacts || goto :error
43%DOTNET% pack --configuration Release Grpc.Reflection --output ..\..\..\artifacts || goto :error
Alexander Polcyn84be2652016-10-27 23:52:16 -070044
Jan Tattermuschd890b252016-11-29 11:05:18 +010045%NUGET% pack Grpc.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts || goto :error
46%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts
Alexander Polcyn84be2652016-10-27 23:52:16 -070047
48@rem copy resulting nuget packages to artifacts directory
49xcopy /Y /I *.nupkg ..\..\artifacts\ || goto :error
50
51@rem create a zipfile with the artifacts as well
52powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets_windows_dotnetcli.zip');"
53xcopy /Y /I csharp_nugets_windows_dotnetcli.zip ..\..\artifacts\ || goto :error
54
55goto :EOF
56
57:error
58echo Failed!
59exit /b %errorlevel%