blob: 924d7b16974c0e633af23061aecd20fa968aff83 [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 Afshari2d43a452018-05-02 22:49:52 -070016set VERSION=1.13.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
Jan Tattermuschd71a6312017-04-21 17:33:40 +020022mkdir ..\..\artifacts
Alexander Polcyn84be2652016-10-27 23:52:16 -070023
24@rem Collect the artifacts built by the previous build step if running on Jenkins
Jan Tattermuschd71a6312017-04-21 17:33:40 +020025mkdir nativelibs
Jan Tattermusch5f3a4522018-03-13 11:04:51 +010026@rem Jenkins flow (deprecated)
Jan Tattermuschd71a6312017-04-21 17:33:40 +020027powershell -Command "cp -r ..\..\platform=*\artifacts\csharp_ext_* nativelibs"
Jan Tattermusch5f3a4522018-03-13 11:04:51 +010028@rem Kokoro flow
29powershell -Command "cp -r ..\..\input_artifacts\csharp_ext_* nativelibs"
Alexander Polcyn84be2652016-10-27 23:52:16 -070030
31@rem Collect protoc artifacts built by the previous build step
Jan Tattermuschd71a6312017-04-21 17:33:40 +020032mkdir protoc_plugins
Jan Tattermusch5f3a4522018-03-13 11:04:51 +010033@rem Jenkins flow (deprecated)
Jan Tattermuschd71a6312017-04-21 17:33:40 +020034powershell -Command "cp -r ..\..\platform=*\artifacts\protoc_* protoc_plugins"
Jan Tattermusch5f3a4522018-03-13 11:04:51 +010035@rem Kokoro flow
36powershell -Command "cp -r ..\..\input_artifacts\protoc_* protoc_plugins"
Alexander Polcyn84be2652016-10-27 23:52:16 -070037
Jan Tattermusch8b435212017-04-05 13:34:37 +020038%DOTNET% restore Grpc.sln || goto :error
Alexander Polcyn84be2652016-10-27 23:52:16 -070039
Jan Tattermusch8b435212017-04-05 13:34:37 +020040@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 +020041xcopy /Y /I nativelibs\csharp_ext_windows_x64\grpc_csharp_ext.dll ..\..\cmake\build\x64\Release\
Jan Tattermusch8b435212017-04-05 13:34:37 +020042
Jan Tattermusch905f4182017-05-23 22:34:14 +020043%DOTNET% pack --configuration Release Grpc.Core --output ..\..\..\artifacts || goto :error
44%DOTNET% pack --configuration Release Grpc.Core.Testing --output ..\..\..\artifacts || goto :error
45%DOTNET% pack --configuration Release Grpc.Auth --output ..\..\..\artifacts || goto :error
46%DOTNET% pack --configuration Release Grpc.HealthCheck --output ..\..\..\artifacts || goto :error
47%DOTNET% pack --configuration Release Grpc.Reflection --output ..\..\..\artifacts || goto :error
Alexander Polcyn84be2652016-10-27 23:52:16 -070048
Jan Tattermuschd890b252016-11-29 11:05:18 +010049%NUGET% pack Grpc.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts || goto :error
50%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% -OutputDirectory ..\..\artifacts
Alexander Polcyn84be2652016-10-27 23:52:16 -070051
52@rem copy resulting nuget packages to artifacts directory
53xcopy /Y /I *.nupkg ..\..\artifacts\ || goto :error
54
55@rem create a zipfile with the artifacts as well
56powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::CreateFromDirectory('..\..\artifacts', 'csharp_nugets_windows_dotnetcli.zip');"
57xcopy /Y /I csharp_nugets_windows_dotnetcli.zip ..\..\artifacts\ || goto :error
58
59goto :EOF
60
61:error
62echo Failed!
63exit /b %errorlevel%