51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
name: Build protos
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
- edited
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Protobufs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.ref }}
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version: '1.27'
|
|
|
|
- name: Install protoc
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y protobuf-compiler
|
|
|
|
- name: Install protoc-gen-go
|
|
run: |
|
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
|
|
|
- name: Generate Protobufs
|
|
run: |
|
|
make proto
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
git config --global user.name "actions[bot]"
|
|
git config --global user.email "noreply@beejay.kim"
|
|
git add .
|
|
git commit -m "Update generated Protobufs" || echo "No changes to commit"
|
|
git push origin ${{ github.ref }} || echo "No changes to push"
|