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 <[email protected]>
  • Loading branch information
negz committed Nov 2, 2023
1 parent 86d9846 commit 0f58a55
Show file tree
Hide file tree
Showing 3 changed files with 49 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 }}
7 changes: 7 additions & 0 deletions apis/buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: protocolbuffers
repository: wellknowntypes
commit: 44e83bc050a4497fa7b36b34d95ca156
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 0f58a55

Please sign in to comment.