Skip to content

Commit

Permalink
preserve original protobuf update process
Browse files Browse the repository at this point in the history
  • Loading branch information
scruplelesswizard committed Sep 22, 2024
1 parent 2e24d24 commit dd31341
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/update_protobufs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Update protobufs and regenerate classes
on:
# On pull requests to master where the protobufs submodule has been updated, update the classes
pull_request:
branches:
- master
paths:
- protobufs/**
# On workflow dispatch, update the protobufs submodule and create a new PR
workflow_dispatch:

jobs:
update-protobufs:
Expand All @@ -16,17 +19,36 @@ jobs:
with:
submodules: true

# If running on a workflow dispatch, create a new PR
- name: Update submodule
if: github.event_name == 'workflow_dispatch'
run: |
git submodule update --remote protobufs
- name: Create pull request
if: github.event_name == 'workflow_dispatch'
uses: peter-evans/create-pull-request@v7
with:
title: Update protobufs and classes
add-paths: |
protobufs
src/mesh
# If running on an existing PR, update the classes and commit the changes to the PR branch
- name: Download nanopb
if: github.event_name == 'pull_request'
run: |
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.8-linux-x86.tar.gz
tar xvzf nanopb-0.4.8-linux-x86.tar.gz
mv nanopb-0.4.8-linux-x86 nanopb-0.4.8
- name: Re-generate protocol buffers
if: github.event_name == 'pull_request'
run: |
./bin/regen-protos.sh
- name: Commit changes
if: github.event_name == 'pull_request'
uses: EndBug/add-and-commit@v9
with:
add: src/mesh
Expand Down

0 comments on commit dd31341

Please sign in to comment.