Skip to content

Commit

Permalink
Push Protobufs to Buf Schema Registry
Browse files Browse the repository at this point in the history
This registry generates us documentation. I believe it also allows us to
avoid copying around protobuf files, which we currently need to do for
each SDK (e.g. https://github.com/crossplane/function-sdk-go/tree/main/proto).

Signed-off-by: Nic Cope <nicc@rk0n.org>
  • Loading branch information
negz committed Oct 27, 2023
1 parent 1008162 commit 494d104
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,35 @@ jobs:
with:
name: artifacts
path: ./out/artifacts


protobuf-schemas:
runs-on: ubuntu-22.04
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'

steps:

- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Setup Buf
uses: bufbuild/buf-setup-action@v1

- name: Lint Protocol Buffers
uses: bufbuild/buf-lint-action@v1
with:
input: apis

- name: Detect Breaking Changes in Protocol Buffers
uses: bufbuild/buf-breaking-action@v1
with:
input: apis
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=master,subdir=apis"

- name: Push Protocol Buffers to Buf Schema Registry
if: github.ref == 'refs/heads/master'
uses: bufbuild/buf-push-action@v1
with:
input: apis
buf_token: ${{ secrets.BUF_TOKEN }}
10 changes: 10 additions & 0 deletions apis/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: v1
name: buf.build/crossplane/crossplane
deps:
- buf.build/protocolbuffers/wellknowntypes:v24.4
breaking:
use:
- FILE
lint:
use:
- DEFAULT

0 comments on commit 494d104

Please sign in to comment.