From d81fc80c417969df1b26436f316f24fccd181c1f Mon Sep 17 00:00:00 2001 From: "Carlos (Goodwine)" <2022649+Goodwine@users.noreply.github.com> Date: Thu, 7 Sep 2023 18:05:19 -0700 Subject: [PATCH] Use buf instead of protoc to compile protobufs (#3670) * Use buf instead of protoc to compile protobufs This is a more consistent way of testing the validation of protobufs. This now avoids relying on protoc which dropped built-in support for generating JS. Fixes #3666 * Create buf.work.yaml and stop generating output to /tmp --- .github/workflows/ci.yml | 6 +++--- .gitignore | 1 + buf.gen.yaml | 4 ++++ buf.work.yaml | 2 ++ 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 buf.gen.yaml create mode 100644 buf.work.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfda5a09..dfe65f9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,10 +72,10 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: arduino/setup-protoc@v1 - with: { version: "3.x", repo-token: "${{ github.token }}" } + - uses: bufbuild/buf-setup-action@v1.26.1 + with: {github_token: "${{ github.token }}"} - name: Generate protobuf code - run: protoc --js_out=/tmp spec/embedded_sass.proto + run: buf generate embedded_protocol_versions: name: "Validate Embedded Protocol versions" diff --git a/.gitignore b/.gitignore index a62ab0ba..1d914351 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,4 @@ typings/ # End of https://www.gitignore.io/api/node /docs +/gen diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 00000000..df200555 --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,4 @@ +version: v1 +plugins: +- plugin: buf.build/bufbuild/es + out: gen diff --git a/buf.work.yaml b/buf.work.yaml new file mode 100644 index 00000000..3059d608 --- /dev/null +++ b/buf.work.yaml @@ -0,0 +1,2 @@ +version: v1 +directories: [spec]