-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.57 KB
/
build.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
55
56
57
name: CICD
# Trigger everytime a push occurs
on:
push:
workflow_dispatch:
paths:
- '!artifacts/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install python requirements
run: |
python -m pip install --upgrade -r requirements.txt
- name: Generate artifacts
run: |
python build.py
- name: Upload artifacts
# upload all files in the artifacts directory
# the artifact zip is available using the following github API
# curl https://api.github.com/repos/open-traffic-generator/models/actions/artifacts
# the artifact is only available for the amount of time dictated by the
# repo settings which is defaulted to 90 days
uses: actions/upload-artifact@v3
with:
path: artifacts
- name: Commit auto generated content
id: commit_generated
run: |
git config user.name "Github Actions Bot"
git config user.email "[email protected]"
git add --force artifacts/openapi.*
git add --force artifacts/*.proto
if git status --porcelain | grep .
then
git commit -m "Update auto generated content"
git push
else
echo "No changed auto generated content"
fi