forked from meshtastic/python
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.67 KB
/
update_protobufs.yml
File metadata and controls
60 lines (50 loc) · 1.67 KB
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
55
56
57
58
59
60
name: "Update protobufs"
on: workflow_dispatch
permissions:
contents: write
jobs:
update-protobufs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Update protobuf submodule
run: |
git submodule sync --recursive
git submodule update --init --recursive
git submodule update --remote --recursive
- name: Download nanopb
run: |
curl -L -o nanopb-0.4.8-linux-x86.tar.gz 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: Install Python dependencies
run: |
poetry install --with dev
- name: Re-generate protocol buffers
run: |
./bin/regen-protobufs.sh
- name: Commit update
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git add protobufs
git add meshtastic/protobuf
if [[ -n "$(git status --porcelain)" ]]; then
git commit -m "Update protobufs"
git push
else
echo "No changes to commit"
fi