xref: /aosp_15_r20/external/grpc-grpc/tools/bazelify_tests/test/build_package_csharp_linux.sh (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1#!/bin/bash
2# Copyright 2023 The gRPC Authors
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16set -ex
17
18mkdir -p artifacts
19
20# List all input artifacts we obtained for easier troubleshooting.
21ls -lR input_artifacts
22
23# Put the input artifacts where the legacy logic for building
24# C# package expects to find them.
25# See artifact_targets.py and package_targets.py for details.
26# TODO(jtattermusch): get rid of the manual renames of artifact directories.
27export EXTERNAL_GIT_ROOT="$(pwd)"
28mv input_artifacts/artifact_protoc_linux_aarch64 input_artifacts/protoc_linux_aarch64 || true
29mv input_artifacts/artifact_protoc_linux_x64 input_artifacts/protoc_linux_x64 || true
30mv input_artifacts/artifact_protoc_linux_x86 input_artifacts/protoc_linux_x86 || true
31
32# In the bazel workflow, we only have linux protoc artifact at hand,
33# so we can only build a "singleplatform" version of the C# package.
34export GRPC_CSHARP_BUILD_SINGLE_PLATFORM_NUGET=1
35
36# TODO(jtattermusch): when building the C# nugets, the current git commit SHA
37# is retrieved and stored as package metadata. But when running
38# as bazelified test, this is not possible since we're not in a git
39# workspace when running the build. This is ok for testing purposes
40# but would be a problem if building a production package
41# for the end users.
42
43src/csharp/build_nuget.sh
44