Define archive control v1 protocol

This commit is contained in:
2026-07-22 11:59:57 +00:00
commit 7652262b4c
25 changed files with 1333 additions and 0 deletions
Executable
+40
View File
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
set -euo pipefail
BUF_IMAGE="${BUF_IMAGE:-bufbuild/buf:1.47.2}"
action="${1:-}"
case "$action" in
format)
shift
set -- format -w "$@"
;;
lint)
shift
set -- lint "$@"
;;
build)
shift
set -- build -o descriptor.bin "$@"
;;
generate)
shift
set -- generate "$@"
;;
breaking)
shift
if [[ $# -ne 1 ]]; then
echo "usage: $0 breaking <against>" >&2
exit 2
fi
set -- breaking --against "$1"
;;
*)
echo "usage: $0 {format|lint|build|generate|breaking <against>}" >&2
exit 2
;;
esac
exec docker run --rm --user "$(id -u):$(id -g)" \
-e XDG_CACHE_HOME=/tmp \
-v "$(pwd):/workspace" -w /workspace "$BUF_IMAGE" "$@"
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
BUF_IMAGE="${BUF_IMAGE:-bufbuild/buf:1.47.2}"
for example in examples/v1/*.json; do
docker run --rm --user "$(id -u):$(id -g)" -e XDG_CACHE_HOME=/tmp \
-v "$(pwd):/workspace" -w /workspace "$BUF_IMAGE" \
convert proto \
--from "$example#format=json" \
--to "/tmp/example.binpb#format=binpb" \
--type archive_control.v1.Envelope
done