Skip to content

Commit

Permalink
fix(ci): update the Buf CI to push tags to the Buf Schema Registry (#280
Browse files Browse the repository at this point in the history
)

This PR fixes the push of a new tag to BSR. 

Tested in my fork in here: https://buf.build/chamirachid/nmt/labels


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced a new GitHub Actions workflow for continuous integration of
Buf-related changes.
- Added a workflow for automating the release of protobuf definitions to
the Buf Schema Registry.
	- New script for downloading the specified version of the `buf` binary.

- **Bug Fixes**
	- Removed the outdated `buf-ci` workflow to streamline processes.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
rach-id authored Oct 7, 2024
1 parent d6a3436 commit b2a0187
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 29 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/buf-ci.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/buf-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: buf-ci
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
buf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/buf-breaking-action@v1
with:
input: pb
against: 'https://github.com/celestiaorg/nmt.git#branch=main,subdir=pb'
- uses: bufbuild/buf-lint-action@v1
with:
input: pb
23 changes: 23 additions & 0 deletions .github/workflows/buf-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: buf-release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
version: "1.44.0"
# Push the protobuf definitions to the BSR
- uses: bufbuild/buf-push-action@v1
with:
buf_token: ${{ secrets.BUF_TOKEN }}
- name: "push the tag label to BSR"
run: |
set -euo pipefail
echo ${{ secrets.BUF_TOKEN }} | buf registry login --token-stdin
buf push --label ${{ github.ref_name }}

0 comments on commit b2a0187

Please sign in to comment.