From a6cb4c026f96f53d90eeb2986eea69b36f50a692 Mon Sep 17 00:00:00 2001 From: pinosu <95283998+pinosu@users.noreply.github.com> Date: Sat, 12 Feb 2022 14:25:36 +0100 Subject: [PATCH] Add GH action to publish proto files to BSR (#753) GH Action includes: - check for lint errors - check for backward compatibility breaking changes Migrated buf config files from v1beta1 to v1 using command: 'buf config migrate-v1beta1' (https://docs.buf.build/configuration/v1beta1-migration-guide) --- .github/workflows/proto-buf-publisher.yml | 33 +++++++++++++++++ buf.work.yaml | 9 +++++ proto/buf.yaml | 21 +++++++++++ buf.yaml => third_party/proto/buf.yaml | 43 ++++++++++++----------- 4 files changed, 85 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/proto-buf-publisher.yml create mode 100644 buf.work.yaml create mode 100644 proto/buf.yaml rename buf.yaml => third_party/proto/buf.yaml (67%) diff --git a/.github/workflows/proto-buf-publisher.yml b/.github/workflows/proto-buf-publisher.yml new file mode 100644 index 00000000..7d823733 --- /dev/null +++ b/.github/workflows/proto-buf-publisher.yml @@ -0,0 +1,33 @@ +name: Proto Buf Publishing - Action +# Protobuf runs buf (https://buf.build/) push updated proto files to https://buf.build/cosmwasm/wasmd +# This workflow is only run when a .proto file has been changed +on: + push: + branches: + - master + paths: + - 'proto/**' + +jobs: + push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: bufbuild/buf-setup-action@v0.7.0 + + # lint checks + - uses: bufbuild/buf-lint-action@v1 + with: + input: 'proto' + + # backward compatibility breaking checks + - uses: bufbuild/buf-breaking-action@v1 + with: + input: 'proto' + against: 'https://github.com/CosmWasm/wasmd.git#branch=master' + + # publish proto files + - uses: bufbuild/buf-push-action@v1 + with: + input: 'proto' + buf_token: ${{ secrets.BUF_TOKEN }} \ No newline at end of file diff --git a/buf.work.yaml b/buf.work.yaml new file mode 100644 index 00000000..98094695 --- /dev/null +++ b/buf.work.yaml @@ -0,0 +1,9 @@ +# Generated by "buf config migrate-v1beta1". Edit as necessary, and +# remove this comment when you're finished. +# +# This workspace file points to the roots found in your +# previous "buf.yaml" configuration. +version: v1 +directories: + - proto + - third_party/proto diff --git a/proto/buf.yaml b/proto/buf.yaml new file mode 100644 index 00000000..12744c1a --- /dev/null +++ b/proto/buf.yaml @@ -0,0 +1,21 @@ +# Generated by "buf config migrate-v1beta1". Edit as necessary, and +# remove this comment when you're finished. +# +# This module represents the "proto" root found in +# the previous configuration. +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT + - COMMENTS + - FILE_LOWER_SNAKE_CASE + except: + - UNARY_RPC + - COMMENT_FIELD + - SERVICE_SUFFIX + - PACKAGE_VERSION_SUFFIX + - RPC_REQUEST_STANDARD_NAME + - PACKAGE_DIRECTORY_MATCH diff --git a/buf.yaml b/third_party/proto/buf.yaml similarity index 67% rename from buf.yaml rename to third_party/proto/buf.yaml index e567e234..d0638a24 100644 --- a/buf.yaml +++ b/third_party/proto/buf.yaml @@ -1,11 +1,23 @@ -version: v1beta1 - +# Generated by "buf config migrate-v1beta1". Edit as necessary, and +# remove this comment when you're finished. +# +# This module represents the "third_party/proto" root found in +# the previous configuration. +version: v1 build: - roots: - - proto - - third_party/proto excludes: - - third_party/proto/google/protobuf + - google/protobuf +breaking: + use: + - FILE + ignore: + - confio + - cosmos + - cosmos_proto + - gogoproto + - google + - ibc + - tendermint lint: use: - DEFAULT @@ -19,21 +31,10 @@ lint: - RPC_REQUEST_STANDARD_NAME - PACKAGE_DIRECTORY_MATCH ignore: + - confio - cosmos + - cosmos_proto + - gogoproto + - google - ibc - tendermint - - gogoproto - - cosmos_proto - - google - - confio -breaking: - use: - - FILE - ignore: - - cosmos - - ibc - - tendermint - - gogoproto - - cosmos_proto - - google - - confio