Skip to content

Commit

Permalink
ci: add buf .github/workflow actions to @observerly/birpc
Browse files Browse the repository at this point in the history
ci: add buf .github/workflow actions to @observerly/birpc
  • Loading branch information
michealroberts committed Oct 14, 2024
1 parent a9db802 commit 7152c42
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Always validate the PR title AND all the commits
titleAndCommits: true
# Allows use of Merge commits (eg on github: "Merge branch 'master' into feature/ride-unicorns")
# this is only relevant when using commitsOnly: true (or titleAndCommits: true)
allowMergeCommits: true
39 changes: 39 additions & 0 deletions .github/workflows/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: protorepo/buf

on:
# Apply to all pull requests on the main branch
pull_request:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
buf:
strategy:
matrix:
os: [ ubuntu-latest ]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout 🛎
uses: actions/checkout@v4

# Install the `buf` CLI
- name: Install buf CLI
uses: bufbuild/buf-setup-action@v1

# Check for breaking changes in the 'proto' directory on all pull requests
- name: Check for Buf breaking changes
uses: bufbuild/buf-breaking-action@v1
with:
input: proto
against: 'https://github.com/observerly/birpc.git#branch=main,ref=HEAD~1,subdir=proto'

# Check for lint errors in the 'proto' directory on all pull requests
- name: Check for Buf lint errors
uses: bufbuild/buf-lint-action@v1
with:
input: proto
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: protorepo/publish

on:
# Apply to all pull requests on the main branch
pull_request:
branches:
- main

release:
types: [published]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
publish:
strategy:
matrix:
os: [ ubuntu-latest ]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout 🛎
uses: actions/checkout@v4

# Install the `buf` CLI
- name: Install buf CLI
uses: bufbuild/buf-setup-action@v1

# Push only the Input in `proto` to the BSR (Buf Schema Registry):
- name: Push to Buf Schema Registry
uses: bufbuild/buf-push-action@v1
with:
input: proto
buf_token: ${{ secrets.BUF_API_TOKEN }}
create_visibility: private
draft: ${{ github.ref_name != 'main'}}

0 comments on commit 7152c42

Please sign in to comment.