GitHub Actions runs repository workflows for building, testing, and deployment. In a Go gRPC microservice system, it can take repetitive Protocol Buffer generation and release work out of the manual development cycle. Workflow files live in `.github/workflows`. section 3.3.2 section 1.4
A tag-driven workflow can publish Go code generated from service `.proto` files:
- Push a release tag to trigger the workflow. section 3.3.2
- Run a job for each service using a matrix strategy; install the required Go and Protocol Buffer tools, then call the generation script. section 3.3.2
- Generate Go source, initialize each service’s Go module, push the changes, and create service-specific tags for clients to consume. section 3.3.2 section 3.3.1
Separate module tags let a client request the latest package or pin a specific version. Pinning is the safer choice when a newer tag might contain incompatible changes. Automation becomes more valuable as the number of services—and the manual generation and tagging work—grows. section 3.3.1
name: "Protocol Buffer Go Stubs Generation"
on:
push:
tags:
- v** #1
jobs:
protoc:
name: "Generate"
runs-on: ubuntu-latest
strategy:
matrix:
service: ["order", "payment", "shipping"] #2
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- uses: actions/checkout@v2
- name: Etract Release Version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV #3
- name: "Generate for Golang"
shell: bash
run: |
chmod +x "${GITHUB_WORKSPACE}/run.sh" #4
./run.sh ${{ matrix.service }} ${{ env.RELEASE_VERSION }} #5
The workflow listing shows the tag trigger, the order/payment/shipping job matrix, and the release version passed to the generation script. section 3.3.2









