diff --git a/.github/workflows/protobuf.yaml b/.github/workflows/protobuf.yaml index 0febd10..40ef475 100644 --- a/.github/workflows/protobuf.yaml +++ b/.github/workflows/protobuf.yaml @@ -16,8 +16,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - submodules: 'true' - name: Run protogen run: make proto - name: Check Protobuf descriptor generation diff --git a/.gitignore b/.gitignore index 01ea400..13c83e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -_proto/** +api/_proto/** .idea/** diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 0464451..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "_proto/googleapis"] - path = _proto/googleapis - url = https://github.com/googleapis/googleapis.git diff --git a/_proto/googleapis b/_proto/googleapis deleted file mode 160000 index a7e2f4f..0000000 --- a/_proto/googleapis +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a7e2f4ff412d5b6818997581b4a67ad99bb2151e diff --git a/api/buf.lock b/api/buf.lock new file mode 100644 index 0000000..6c4355d --- /dev/null +++ b/api/buf.lock @@ -0,0 +1,8 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 28151c0d0a1641bf938a7672c500e01d + digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de diff --git a/api/buf.yaml b/api/buf.yaml new file mode 100644 index 0000000..4a1c082 --- /dev/null +++ b/api/buf.yaml @@ -0,0 +1,13 @@ +version: v1 +name: buf.build/indent/multiparty + +deps: + - buf.build/googleapis/googleapis:28151c0d0a1641bf938a7672c500e01d + +breaking: + use: + - FILE + +lint: + use: + - DEFAULT diff --git a/api/multiparty/v1/buf.gen.yaml b/api/multiparty/v1/buf.gen.yaml index 4545afb..a22a8f7 100644 --- a/api/multiparty/v1/buf.gen.yaml +++ b/api/multiparty/v1/buf.gen.yaml @@ -4,4 +4,4 @@ plugins: - plugin: go opt: - paths=source_relative - out: api + out: . diff --git a/buf.yaml b/buf.yaml deleted file mode 100644 index 50093ae..0000000 --- a/buf.yaml +++ /dev/null @@ -1,12 +0,0 @@ -version: v1beta1 - -build: - roots: - - api - - _proto/googleapis -lint: - use: - - DEFAULT - ignore: - - google - - grafeas diff --git a/proto.mk b/proto.mk index cf365a8..1b930be 100644 --- a/proto.mk +++ b/proto.mk @@ -1,22 +1,27 @@ -GET="./scripts/get.sh" +.PHONY: proto -PROTO=_proto -BUF := PATH=$(PROTO):$(PROTO)/protoc/bin:$$PATH $(PROTO)/buf +API=api +PROTO=api/_proto +GET=./scripts/get.sh +BUF := cd $(API) && PATH=$(notdir $(PROTO)):$(notdir $(PROTO))/protoc/bin:$$PATH buf -proto: api/multiparty/v1/buf.gen.yaml \ +PKGS := \ + multiparty/v1 + +proto: $(PKGS) + +$(PKGS): proto-deps + $(BUF) generate --path $@ --template $@/buf.gen.yaml + $(BUF) build . --path $@ --as-file-descriptor-set -o $@/$(notdir $@).descriptor.pb + +proto-deps: \ $(PROTO)/buf \ - $(PROTO)/googleapis \ $(PROTO)/protoc/bin/protoc \ $(PROTO)/protoc-gen-go - $(BUF) generate --path api/multiparty/v1 --template $< - $(BUF) build . --path api/multiparty/v1 --as-file-descriptor-set -o api/multiparty/v1/v1.descriptor.pb $(PROTO)/buf: @$(GET) buf -$(PROTO)/googleapis: - @git submodule update --quiet --depth=1 --init $@ >/dev/null 2>&1 - $(PROTO)/protoc/bin/protoc: @$(GET) protoc diff --git a/scripts/get.sh b/scripts/get.sh index 51c364e..4ad0381 100755 --- a/scripts/get.sh +++ b/scripts/get.sh @@ -20,7 +20,7 @@ set -euo pipefail SUMS="$(dirname "$(readlink -f "$0")")/get.sha256" -OUTDIR="$(dirname "$(readlink -f "$0")")/../_proto" +OUTDIR="$(dirname "$(readlink -f "$0")")/../api/_proto" # write to temp file and cleanup later tmpDir="$(mktemp -d)"