From 4bcc41af5cdad04c542a7a8e7239da04381c028e Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Mon, 11 Jul 2022 17:08:30 +0000 Subject: [PATCH 1/5] 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 From 2656854aa8d36caf95571b70d0b414c1a22bc918 Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Mon, 11 Jul 2022 17:23:14 +0000 Subject: [PATCH 2/5] Rename and fix dist errors --- Makefile.am | 7 ++----- csharp/BUILD.bazel | 7 ++++--- csharp/{csharp_release_build.sh => build_release.sh} | 0 3 files changed, 6 insertions(+), 8 deletions(-) rename csharp/{csharp_release_build.sh => build_release.sh} (100%) diff --git a/Makefile.am b/Makefile.am index 05c2c5c1b3..a915967d1d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,4 @@ -## Process this file with automake to produce Makefile.in - -ACLOCAL_AMFLAGS = -I m4 - -AUTOMAKE_OPTIONS = foreign +## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign # Build . before src so that our all-local and clean-local hooks kicks in at # the right time. @@ -62,6 +58,7 @@ csharp_EXTRA_DIST= \ csharp/NuGet.Config \ csharp/README.md \ csharp/build_packages.bat \ + csharp/build_release.sh \ csharp/build_tools.sh \ csharp/buildall.bat \ csharp/buildall.sh \ diff --git a/csharp/BUILD.bazel b/csharp/BUILD.bazel index 02a7aa8dd1..4f3556647f 100644 --- a/csharp/BUILD.bazel +++ b/csharp/BUILD.bazel @@ -39,6 +39,7 @@ pkg_files( "NuGet.Config", "README.md", "build_packages.bat", + "build_release.sh", "build_tools.sh", "buildall.bat", "buildall.sh", @@ -53,7 +54,7 @@ pkg_files( ) sh_binary( - name = "csharp_release_build", - srcs = ["csharp_release_build.sh"], - args = ["$(location csharp_release_build.sh)"], + name = "release", + srcs = ["build_release.sh"], + args = ["$(location build_release.sh)"], ) diff --git a/csharp/csharp_release_build.sh b/csharp/build_release.sh similarity index 100% rename from csharp/csharp_release_build.sh rename to csharp/build_release.sh From 3cb6d214dfbaa44758a4cf341ab5a3dfbde43778 Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Mon, 11 Jul 2022 17:29:38 +0000 Subject: [PATCH 3/5] Revert unintended change --- Makefile.am | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index a915967d1d..0a3eb0ef24 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,8 @@ -## Process this file with automake to produce Makefile.in ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign +## Process this file with automake to produce Makefile.in + +ACLOCAL_AMFLAGS = -I m4 + +AUTOMAKE_OPTIONS = foreign # Build . before src so that our all-local and clean-local hooks kicks in at # the right time. From 765d3a2115263fdef83683efc26b500b237f28f4 Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Mon, 11 Jul 2022 17:46:22 +0000 Subject: [PATCH 4/5] Remove target from bazel testing --- kokoro/linux/bazel_distcheck/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/kokoro/linux/bazel_distcheck/build.sh b/kokoro/linux/bazel_distcheck/build.sh index 7c8c53990c..a50b175db2 100755 --- a/kokoro/linux/bazel_distcheck/build.sh +++ b/kokoro/linux/bazel_distcheck/build.sh @@ -55,6 +55,7 @@ bazel_args=( -- //... -//objectivec/... # only works on macOS + -//csharp/... # release builds require external dependencies @com_google_protobuf_examples//... ) ${SCRIPT_ROOT}/kokoro/common/bazel_wrapper.sh "${bazel_args[@]}" From 30fea6696a0f57d8a45e14f9b533c635b784aeff Mon Sep 17 00:00:00 2001 From: Deanna Garcia Date: Tue, 12 Jul 2022 16:07:02 +0000 Subject: [PATCH 5/5] Reformat comments --- csharp/build_release.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csharp/build_release.sh b/csharp/build_release.sh index c14eeaf55a..93f318f388 100755 --- a/csharp/build_release.sh +++ b/csharp/build_release.sh @@ -2,16 +2,16 @@ cd $(dirname $(readlink $BASH_SOURCE)) -#Disable some unwanted dotnet options +# 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 +# Work around https://github.com/dotnet/core/issues/5881 dotnet nuget locals all --clear -#Builds Google.Protobuf NuGet packages +# 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 +# This requires built protoc executables as specified in the nusepc nuget pack Google.Protobuf.Tools.nuspec