From a098f704e8bec689ed2a761f8006206cf76931d7 Mon Sep 17 00:00:00 2001 From: strophy Date: Thu, 16 Mar 2023 12:31:02 +0800 Subject: [PATCH] feat: add nanopb support --- .github/workflows/dockerimage.yml | 1 + Dockerfile | 5 ++++- README.md | 1 + deps.list | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index a3c6e846..393ecd31 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -89,6 +89,7 @@ jobs: PROTOC_GEN_GQL_VERSION=${{ env.PROTOC_GEN_GQL_VERSION }} PROTOC_GEN_JSONSCHEMA_VERSION=${{ env.PROTOC_GEN_JSONSCHEMA_VERSION }} PROTOC_GEN_LINT_VERSION=${{ env.PROTOC_GEN_LINT_VERSION }} + PROTOC_GEN_NANOPB_VERSION=${{ env.PROTOC_GEN_NANOPB_VERSION }} PROTOC_GEN_RUST_VERSION=${{ env.PROTOC_GEN_RUST_VERSION }} PROTOC_GEN_SCALA_VERSION=${{ env.PROTOC_GEN_SCALA_VERSION }} PROTOC_GEN_TS_VERSION=${{ env.PROTOC_GEN_TS_VERSION }} diff --git a/Dockerfile b/Dockerfile index 031b4d14..93184170 100644 --- a/Dockerfile +++ b/Dockerfile @@ -430,11 +430,13 @@ RUN apk add --no-cache \ grpc-plugins \ protobuf \ protobuf-dev \ - protobuf-c-compiler + protobuf-c-compiler \ + python3 COPY --from=upx /out/ / COPY --from=protoc_gen_ts /out/ / COPY --from=protoc_gen_dart /out/ / COPY --from=protoc_gen_dart /runtime/ / +RUN python3 -m ensurepip && pip3 install --no-cache nanopb RUN ln -s /usr/bin/grpc_cpp_plugin /usr/bin/protoc-gen-grpc-cpp RUN ln -s /usr/bin/grpc_csharp_plugin /usr/bin/protoc-gen-grpc-csharp RUN ln -s /usr/bin/grpc_node_plugin /usr/bin/protoc-gen-grpc-js @@ -468,6 +470,7 @@ RUN protoc-wrapper \ --java_out=/test \ --jsonschema_out=/test \ --lint_out=/test \ + --nanopb_out=/test \ --php_out=/test \ --python_out=/test \ --ruby_out=/test \ diff --git a/README.md b/README.md index 2529606d..232ee27d 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ It started out as https://github.com/znly/docker-protobuf fork, but grew into a - [infobloxopen/protoc-gen-gorm](https://github.com/infobloxopen/protoc-gen-gorm) - [moul/protoc-gen-gotemplate](https://github.com/moul/protoc-gen-gotemplate) - [mwitkow/go-proto-validators](https://github.com/mwitkow/go-proto-validators) +- [nanopb/nanopb](https://github.com/nanopb/nanopb) - [protobuf-c/protobuf-c](https://github.com/protobuf-c/protobuf-c) - [pseudomuto/protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) - [scalapb/scalapb](https://github.com/scalapb/scalapb) diff --git a/deps.list b/deps.list index 46199038..7193fa98 100644 --- a/deps.list +++ b/deps.list @@ -19,6 +19,7 @@ PROTOC_GEN_GQL_VERSION=v0.8.0 PROTOC_GEN_JS_VERSION=v3.21.2 PROTOC_GEN_JSONSCHEMA_VERSION=1.4.0 PROTOC_GEN_LINT_VERSION=v0.3.0 +PROTOC_GEN_NANOPB_VERSION=0.4.7 PROTOC_GEN_RUST_VERSION=v3.2.0 PROTOC_GEN_SCALA_VERSION=v0.11.13 PROTOC_GEN_TS_VERSION=0.15.0