Skip to content

Commit

Permalink
ci: support releasing proto definitions to BSR (#274)
Browse files Browse the repository at this point in the history
Adds support for pushing the proto definitions to BSR

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a continuous integration (CI) workflow for automated checks
on Protocol Buffers.
	- Added a new module configuration for managing protocol buffers.

- **Documentation**
	- New workflow file created to outline CI processes.
	- Configuration file established for module versioning and structure.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Rootul P <[email protected]>
  • Loading branch information
rach-id and rootulp authored Sep 25, 2024
1 parent 29e9433 commit d6a3436
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/buf-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: buf-ci
on:
push:
branches:
- main
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
buf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-action@v1
with:
token: ${{ secrets.BUF_TOKEN }}
input: "pb"
breaking-against: 'https://github.com/celestiaorg/nmt.git#branch=main,ref=HEAD~1,subdir=pb'
# Run breaking change, lint, and format checks for Protobuf sources against all branches,
# 'pb' subdirectory, then push to the Buf Schema Registry once validated
lint: true
format: true
breaking: true
12 changes: 12 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: v2
modules:
- path: pb
name: buf.build/celestia/nmt
lint:
ignore_only:
PACKAGE_DIRECTORY_MATCH:
# ignoring because fixing means we will do a breaking change
- pb/proof.proto
PACKAGE_VERSION_SUFFIX:
# ignoring because fixing means we will do a breaking change
- pb/proof.proto
10 changes: 5 additions & 5 deletions pb/proof.proto
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
syntax="proto3";
syntax = "proto3";

package proof.pb;

option go_package = "github.com/celestiaorg/nmt/pb";

message Proof {
// Start index of the leaves that match the queried namespace.ID.
int64 start = 1;
int64 start = 1;
// End index (non-inclusive) of the leaves that match the queried
// namespace.ID.
int64 end = 2;
int64 end = 2;
// Nodes hold the tree nodes necessary for the Merkle range proof.
repeated bytes nodes = 3;
// leaf_hash contains the namespace.ID if NMT does not have it and
Expand All @@ -18,5 +18,5 @@ message Proof {
bytes leaf_hash = 4;
// The is_max_namespace_ignored flag influences the calculation of the
// namespace ID range for intermediate nodes in the tree.
bool is_max_namespace_ignored=5;
}
bool is_max_namespace_ignored = 5;
}

0 comments on commit d6a3436

Please sign in to comment.