Skip to content

Add new-release workflow (#76) #434

Add new-release workflow (#76)

Add new-release workflow (#76) #434

Workflow file for this run

name: Protobuf
concurrency:
group: ${{github.repository}}-${{ github.ref_name }}-proto
cancel-in-progress: true
permissions:
contents: write
pull-requests: read
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
proto:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: ${{ startsWith(github.event_name, 'pull_request') }}
with:
ref: ${{github.event.pull_request.head.ref}}
- uses: actions/checkout@v4
if: ${{ !startsWith(github.event_name, 'pull_request') }}
- run: git config --global url.https://[email protected]/.insteadOf https://github.com/
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/buf-lint-action@v1
# - uses: bufbuild/buf-breaking-action@v1
# with:
# # The 'main' branch of the GitHub repository that defines the module.
# against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main"
# input: "proto"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
## it would be good to compile it else where so we can just download the exec
- name: Clone and build proto-gen-md-diagrams
run: |
cd ..
git clone https://github.com/GoogleCloudPlatform/proto-gen-md-diagrams.git
cd proto-gen-md-diagrams
go build
cd ..
cd protobuf
- name: Generate docs
run: |
make docs
- name: Generating protos
run: |
make generate
- name: Golines
run: |
go install github.com/segmentio/golines@latest
golines . -w
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --fix
version: latest
- name: Commit buf changes
run: |
git config --global user.name 'Bot'
git config --global user.email '[email protected]'
git add --all && git commit -m "Buf re-generated protos" || echo "No changes to commit"
git push
golang:
needs: proto
uses: zaphiro-technologies/github-workflows/.github/workflows/golang.yaml@main
secrets: inherit