Repository navigation
57 lines (50 loc) · 1.81 KB
/
Copy pathprotocol-converter.yml
File metadata and controls
57 lines (50 loc) · 1.81 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
name: Convert the protocol definition
on:
workflow_call:
secrets:
personal_access_token:
required: true
jobs:
build:
runs-on: ubuntu-latest
env:
protocol-repo: intechstudio/grid-protocol.git
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Clone protocol repository
run: git clone https://github.com/${{ env.protocol-repo }}
- name: Setup python
uses: actions/setup-python@v6
- name: Run protocol converter
run: "python ./.github/workflows/protocol_converter.py \
./common/src/c/grid_protocol.h,\
./common/src/c/grid_ui_system.h,\
./common/src/c/grid_ui_button.h,\
./common/src/c/grid_ui_encoder.h,\
./common/src/c/grid_ui_endless.h,\
./common/src/c/grid_ui_potmeter.h,\
./common/src/c/grid_ui_lcd.h,\
./common/src/c/grid_ui_touch.h,\
./common/src/c/lua_source_collection.h \
grid-protocol/src/grid_protocol_bot.json \
grid-protocol/grid-protocol/lists.py"
- name: Validate generated protocol file
run: |
cd grid-protocol
npm ci
npm test
- name: Push file to protocol repository
if: github.ref_name == 'main' || github.ref_name == 'master'
run: |
cd grid-protocol
cat -v src/grid_protocol_bot.json
if [ -n "$(git status --porcelain)" ] ; then
git add --all
git config --global user.email "bot@intech.studio"
git config --global user.name "Intech Bot"
git commit -m "BOT protocol file synced from grid-fw repo"
git remote set-url origin \
https://${{ secrets.personal_access_token }}@github.com/${{ env.protocol-repo }}
git push
fi