-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (51 loc) · 1.71 KB
/
all-branch-builder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: all branch builder
on:
pull_request:
branches: [ "main" ]
push:
# allow manual runs too
workflow_dispatch:
inputs:
force_breaking:
type: boolean
description: 'TODO - force codegen even with breaking changes'
required: false
default: false
jobs:
check-for-breaking:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
- uses: bufbuild/buf-breaking-action@v1
with:
against: 'https://github.com/${{ github.repository }}.git#branch=main'
gen-csharp:
runs-on: ubuntu-latest
needs: [check-for-breaking]
strategy:
matrix:
dotnet-version: ['6.0.x']
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install dependencies
run: |
dotnet new tool-manifest
dotnet tool install --local protobuf-net.Protogen --version 3.1.17
# recursion doesn't work in protogen so do this instead
- name: generate csharp code
run: find -name '*.proto' | xargs dotnet tool run protogen --csharp_out=./generated/csharp
# Commit and push all changed files.
- name: git commit generated code
# only run on main branch push (after pull request merged)
if: github.event_name == 'push'
run: |
git config --global user.name "autocommit"
git config --global user.email "[email protected]"
git add ./generated/csharp
git commit --allow-empty -a -m "autocommit from CI job"
git push