From 4bcc41af5cdad04c542a7a8e7239da04381c028e Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Mon, 11 Jul 2022 17:08:30 +0000 Subject: [PATCH] Add bazel rule to build C# release artifacts --- csharp/BUILD.bazel | 6 ++++++ csharp/csharp_release_build.sh | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 csharp/csharp_release_build.sh diff --git a/csharp/BUILD.bazel b/csharp/BUILD.bazel index 1b381b3a34..02a7aa8dd1 100644 --- a/csharp/BUILD.bazel +++ b/csharp/BUILD.bazel @@ -51,3 +51,9 @@ pkg_files( strip_prefix = strip_prefix.from_root(""), visibility = ["//pkg:__pkg__"], ) + +sh_binary( + name = "csharp_release_build", + srcs = ["csharp_release_build.sh"], + args = ["$(location csharp_release_build.sh)"], +) diff --git a/csharp/csharp_release_build.sh b/csharp/csharp_release_build.sh new file mode 100755 index 0000000000..c14eeaf55a --- /dev/null +++ b/csharp/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