-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (51 loc) · 2.12 KB
/
unity-generate-uml.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
58
59
name: Generate UML
on:
push:
branches:
- master
workflow_dispatch:
jobs:
generate-uml:
name: 'Generate UML'
runs-on: ubuntu-latest
env:
CODE_PATH: "./Assets/Scripts/"
UML_OUTPUT_PATH: "./UML/"
UMP_GENERATION_PARAMETERS: -public -createAssociation -allInOne
steps:
- uses: actions/checkout@v2
- name: Remove old diagrams
run: rm -r ${{ env.UML_OUTPUT_PATH }} || true
- name: Check if there is code
run: |
[ -d ${{ env.CODE_PATH }} ] && echo "::set-output name=CODE_EXISTS::true" || true
id: check_for_code
- uses: actions/setup-dotnet@v1
if: ${{ steps.check_for_code.outputs.CODE_EXISTS == 'true' }}
with:
dotnet-version: 5.0.x
- if: ${{ steps.check_for_code.outputs.CODE_EXISTS == 'true' }}
run: dotnet tool install --global PlantUmlClassDiagramGenerator --version 1.2.4
- if: ${{ steps.check_for_code.outputs.CODE_EXISTS == 'true' }}
run: dotnet tool restore
- name: Create a folder for diagrams
if: ${{ steps.check_for_code.outputs.CODE_EXISTS == 'true' }}
run: mkdir ${{ env.UML_OUTPUT_PATH }}
- name: Generate PlantUML files
if: ${{ steps.check_for_code.outputs.CODE_EXISTS == 'true' }}
run: puml-gen ${{ env.CODE_PATH }} ${{ env.UML_OUTPUT_PATH }} -dir ${{ env.UMP_GENERATION_PARAMETERS }}
- name: Get File names
if: ${{ steps.check_for_code.outputs.CODE_EXISTS == 'true' }}
run: |
echo "::set-output name=UML_FILES::$(find ${{ env.UML_OUTPUT_PATH }} -name "*.puml" | tr '\n' ' ')"
id: get_file_names
- name: Generate SVG Diagrams
if: ${{ steps.check_for_code.outputs.CODE_EXISTS == 'true' }}
uses: cloudbees/plantuml-github-action@master
with:
args: -v -tsvg ${{ steps.get_file_names.outputs.UML_FILES }}
- uses: EndBug/[email protected]
with:
author_name: 'UML Bot'
message: 'Generate UML (${{ github.workflow }})'
author_email: 41898282+uml-bot[bot]@users.noreply.github.com