build: Generate .pb.go from proto files to support Golang

This commit is contained in:
Bart
2026-07-03 16:36:54 -04:00
parent c92285f10d
commit f4ceb23d40
24 changed files with 2268 additions and 7 deletions

View File

@@ -203,7 +203,7 @@ jobs:
To fix this:
1. Run: cmake --build . --target setup_code_gen
2. Run: cmake --build . --target code_gen
3. Commit and push the regenerated files
3. Commit and push the regenerated files.
run: |
set -e
cmake --build . --target setup_code_gen
@@ -216,6 +216,35 @@ jobs:
exit 1
fi
- name: Check Go protobuf bindings are up-to-date
working-directory: ${{ env.BUILD_DIR }}
env:
GO_PROTO_DIR: proto/org/xrpl/rpc/v1
MESSAGE: |
The generated Go protobuf bindings are out of date.
This happens when the .proto files under proto/org/xrpl/rpc/v1
changed but the committed .pb.go files were not regenerated, or when
they were generated with a different protoc / plugin version than
the one pinned in the Nix environment.
To fix this:
1. Enter the Nix environment (nix develop) so protoc and the
protoc-gen-go* plugins match the pinned versions.
2. Run: cmake --build . --target go_protobuf
3. Commit and push the regenerated files.
run: |
set -e
cmake --build . --target go_protobuf
DIFF=$(git -C .. status --porcelain -- "${GO_PROTO_DIR}")
if [ -n "${DIFF}" ]; then
echo "::error::Generated Go protobuf bindings are out of date"
git -C .. diff -- "${GO_PROTO_DIR}"
echo "${MESSAGE}"
exit 1
fi
- name: Build the binary
working-directory: ${{ env.BUILD_DIR }}
env: