1#!/usr/bin/env bash 2# Copyright 2022 The ChromiumOS Authors 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6BUILD_DIR=$(mktemp -d) 7cd "$BUILD_DIR" || exit 1 8 9CIPD_ARGS=( 10 -pkg-var "description:Protoc compiler" 11 -install-mode copy 12 -ref latest 13) 14 15PROTOC_URL="https://github.com/protocolbuffers/protobuf/releases/download/v21.1/protoc-21.1" 16 17cd $(mktemp -d) 18mkdir pkg 19wget -q "$PROTOC_URL-win64.zip" -O "protoc.zip" 20unzip -p "protoc.zip" "bin/protoc.exe" > "pkg/protoc.exe" 21cipd create -in "pkg" -name "crosvm/protoc/windows-amd64" "${CIPD_ARGS[@]}" 22 23cd $(mktemp -d) 24mkdir pkg 25wget -q "$PROTOC_URL-linux-x86_64.zip" -O "protoc.zip" 26unzip -p "protoc.zip" "bin/protoc" > "pkg/protoc" 27cipd create -in "pkg" -name "crosvm/protoc/linux-amd64" "${CIPD_ARGS[@]}" 28