Skip to content

Commit

Permalink
feat: push tapir to Buf schema registry for each new tag (#553)
Browse files Browse the repository at this point in the history
* feat: push tapir to Buf schema registry for each new tag

see https://buf.build/stroeer/tapir

* use https://buf.build/docs/reference/cli/buf/push#git-metadata for pushes
  • Loading branch information
moritzzimmer authored Jul 5, 2024
1 parent 1626ac5 commit 386517f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,21 @@ jobs:
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.GO_TAPIR_TOKEN }} \
--data '{"event_type": "publish", "client_payload": { "tag": "'"$RELEASE_TAG"'" }}'
bsr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: push
env:
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
run: |
RELEASE_TAG=${GITHUB_REF/refs\/tags\/v/}
echo $RELEASE_TAG
make push
4 changes: 4 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ jobs:
- uses: actions/checkout@v4

- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: bufbuild/buf-lint-action@v1

Expand All @@ -106,6 +108,8 @@ jobs:
- uses: actions/checkout@v4

- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: bufbuild/buf-breaking-action@v1
if: always()
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
all: generate test fmt lint breaking
all: build generate test fmt lint breaking

TEMPLATE ?= buf.gen.yaml
.PHONY: generate
Expand All @@ -21,6 +21,17 @@ fmt: ## Formats all proto files using https://docs.buf.build/format/style
@echo "+ $@"
@buf format -w

.PHONY: build
build: ## Builds buf image, see https://buf.build/docs/reference/images
@echo "+ $@"
@buf build

LABEL ?=
.PHONY: push
push: build ## Pushes tapir to the buf schema registry, see https://buf.build/docs/bsr/introduction and https://buf.build/docs/bsr/module/publish#pushing-with-labels
@echo "+ $@"
@buf push --git-metadata

.PHONY: test
test: generate ## Runs all tests
@echo "+ $@"
Expand Down

0 comments on commit 386517f

Please sign in to comment.