-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.14 KB
/
dev.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
name: Generate MQTT topics build
on:
workflow_dispatch:
push:
branches:
- main
jobs:
library:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Run generator
run: |
sudo apt-get install -y graphviz
pip install -r requirements.txt
python3 src/generator/main.py . out
mkdir -p /tmp/workspace
cp -R out/* /tmp/workspace
- uses: actions/checkout@v2
with:
ref: build
- name: Push generated files
id: commit
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git rm -r --ignore-unmatch */*
rm -rf *
cp -r /tmp/workspace/* .
git add .
if [[ $(git status --porcelain) ]]; then git commit -am "chore: automatically generated files" && git push; fi
echo "::set-output name=HASH::$(git rev-parse HEAD)"