Run Buf Code Generation #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Run Buf Code Generation" | |
on: | |
workflow_dispatch: {} | |
workflow_call: {} | |
jobs: | |
codegen: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install protoc | |
run: | | |
PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip | |
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/$PROTOC_ZIP | |
unzip -o $PROTOC_ZIP -d . bin/protoc | |
unzip -o $PROTOC_ZIP -d . 'include/*' | |
rm -f $PROTOC_ZIP | |
echo "$(pwd)/bin" >> "$GITHUB_PATH" | |
- name: Setup npm | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.11.0 | |
cache: "npm" | |
cache-dependency-path: "buf.gen.yaml" | |
- name: Install node protoc plugins | |
run: | | |
npm install -g @bufbuild/protoc-gen-es @connectrpc/protoc-gen-connect-es | |
- name: Install Prost from Cargo | |
uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: protoc-gen-prost | |
- name: Install protoc-gen-prost-crate from Cargo | |
uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: protoc-gen-prost-crate | |
- name: Install Prost serde from Cargo | |
uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: protoc-gen-prost-serde | |
- name: Install Tonic from Cargo | |
uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: protoc-gen-tonic | |
- name: Setup Haskell | |
uses: ./.github/actions/setup-protoc-hololens | |
- name: Install Buf from npm | |
run: npm install -g @bufbuild/buf | |
- name: Generate code | |
run: buf generate proto | |
- name: Create codegen artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: codegen | |
path: "gen/**" |