diff --git a/.github/renovate.json5 b/.github/renovate.json5 index be10cd24..553e3f44 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -190,6 +190,16 @@ ], depNameTemplate: "mypy-protobuf", datasourceTemplate: "pypi", + }, + { + fileMatch: [ + "variables.sh$" + ], + matchStrings: [ + "PROTOBUF_JS_VERSION=\\$\\{PROTOBUF_JS_VERSION:-(?.*?)\\}\\n" + ], + depNameTemplate: "protocolbuffers/protobuf-javascript", + datasourceTemplate: "github-releases", } ], packageRules: [ diff --git a/Dockerfile b/Dockerfile index 7cfd0fda..047c1ac9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,7 @@ ARG go_mwitkow_gpv_version ARG go_protoc_gen_go_version ARG go_protoc_gen_go_grpc_version ARG mypy_version +ARG protobuf_js_version FROM golang:$go_version-$debian_version AS build @@ -30,6 +31,7 @@ ARG uber_prototool_version ARG go_protoc_gen_go_version ARG go_protoc_gen_go_grpc_version ARG mypy_version +ARG protobuf_js_version RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ @@ -49,7 +51,8 @@ RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /tmp RUN git clone --depth 1 --shallow-submodules -b v$grpc_version.x --recursive https://github.com/grpc/grpc && \ - git clone --depth 1 --shallow-submodules -b v$grpc_java_version.x --recursive https://github.com/grpc/grpc-java.git && \ + git clone --depth 1 --shallow-submodules -b v$grpc_java_version.x --recursive https://github.com/grpc/grpc-java && \ + git clone --depth 1 --shallow-submodules -b $protobuf_js_version --recursive https://github.com/protocolbuffers/protobuf-javascript && \ git clone --depth 1 https://github.com/googleapis/googleapis && \ git clone --depth 1 https://github.com/googleapis/api-common-protos @@ -63,6 +66,9 @@ RUN $bazel build //external:protocol_compiler && \ WORKDIR /tmp/grpc-java RUN $bazel build //compiler:grpc_java_plugin +WORKDIR /tmp/protobuf-javascript +RUN $bazel build //generator:protoc-gen-js + WORKDIR /tmp # Install protoc required by envoyproxy/protoc-gen-validate package RUN cp -a /tmp/grpc/bazel-bin/external/com_google_protobuf/. /usr/local/bin/ @@ -164,6 +170,8 @@ COPY --from=build /tmp/grpc/bazel-bin/external/com_google_protobuf/ /usr/local/b COPY --from=build /tmp/grpc/bazel-bin/src/compiler/ /usr/local/bin/ # Copy protoc java plugin COPY --from=build /tmp/grpc-java/bazel-bin/compiler/ /usr/local/bin/ +# Copy protoc js plugin +COPY --from=build /tmp/protobuf-javascript/bazel-bin/generator/protoc-gen-js /usr/local/bin/ # Copy grpc_cli COPY --from=build /tmp/grpc/bazel-bin/test/cpp/util/ /usr/local/bin/ diff --git a/build.sh b/build.sh index 06020571..fbb7bf87 100755 --- a/build.sh +++ b/build.sh @@ -14,6 +14,7 @@ for build in ${BUILDS[@]}; do --build-arg grpc_web_version="${GRPC_WEB_VERSION}" \ --build-arg grpc_gateway_version="${GRPC_GATEWAY_VERSION}" \ --build-arg go_version="${GO_VERSION}" \ + --build-arg protobuf_js_version="${PROTOBUF_JS_VERSION}" \ --build-arg uber_prototool_version="${UBER_PROTOTOOL_VERSION}" \ --build-arg scala_pb_version="${SCALA_PB_VERSION}" \ --build-arg mypy_version="${MYPY_VERSION}" \ diff --git a/variables.sh b/variables.sh index 693e5609..ea0480b8 100755 --- a/variables.sh +++ b/variables.sh @@ -12,6 +12,7 @@ GRPC_VERSION=${GRPC_VERSION:-1.48} GRPC_JAVA_VERSION=${GRPC_JAVA_VERSION:-1.48} GRPC_WEB_VERSION=${GRPC_WEB_VERSION:-1.3.1} GRPC_GATEWAY_VERSION=${GRPC_GATEWAY_VERSION:-v2.0.1} +PROTOBUF_JS_VERSION=${PROTOBUF_JS_VERSION:-v3.21.0} UBER_PROTOTOOL_VERSION=${UBER_PROTOTOOL_VERSION:-1.10.0} SCALA_PB_VERSION=${SCALA_PB_VERSION:-0.11.0} MYPY_VERSION=${MYPY_VERSION:-3.3.0} @@ -19,7 +20,7 @@ NODE_VERSION=${NODE_VERSION:-14} NODE_GRPC_TOOLS_NODE_PROTOC_TS_VERSION=${NODE_GRPC_TOOLS_NODE_PROTOC_TS_VERSION:-5.3.2} NODE_GRPC_TOOLS_VERSION=${NODE_GRPC_TOOLS_VERSION:-1.11.2} NODE_PROTOC_GEN_GRPC_WEB_VERSION=${NODE_PROTOC_GEN_GRPC_WEB_VERSION:-1.4.0} -TS_PROTO_VERSION=${TS_PROTO_VERSION:1.117.0} +TS_PROTO_VERSION=${TS_PROTO_VERSION:-1.117.0} GO_ENVOYPROXY_PGV_VERSION=${GO_ENVOYPROXY_PGV_VERSION:-0.6.8} GO_MWITKOW_GPV_VERSION=${GO_MWITKOW_GPV_VERSION:-0.3.2} GO_PROTOC_GEN_GO_VERSION=${GO_PROTOC_GEN_GO_VERSION:-v1.28.1}