Add bazel rule to build C# release artifacts

pull/10241/head
Deanna Garcia 3 years ago
parent aa22c5e0de
commit 4bcc41af5c
  1. 6
      csharp/BUILD.bazel
  2. 17
      csharp/csharp_release_build.sh

@ -51,3 +51,9 @@ pkg_files(
strip_prefix = strip_prefix.from_root(""), strip_prefix = strip_prefix.from_root(""),
visibility = ["//pkg:__pkg__"], visibility = ["//pkg:__pkg__"],
) )
sh_binary(
name = "csharp_release_build",
srcs = ["csharp_release_build.sh"],
args = ["$(location csharp_release_build.sh)"],
)

@ -0,0 +1,17 @@
#!/bin/bash
cd $(dirname $(readlink $BASH_SOURCE))
#Disable some unwanted dotnet options
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
set DOTNET_CLI_TELEMETRY_OPTOUT=true
#Work around https://github.com/dotnet/core/issues/5881
dotnet nuget locals all --clear
#Builds Google.Protobuf NuGet packages
dotnet restore src/Google.Protobuf.sln
dotnet pack -c Release src/Google.Protobuf.sln -p:ContinuousIntegrationBuild=true
#This requires built protoc executables as specified in the nusepc
nuget pack Google.Protobuf.Tools.nuspec
Loading…
Cancel
Save