GITBOOK-23: change request with no subject merged in GitBook #117
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate UML | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
generate-uml: | |
name: 'Generate UML' | |
runs-on: ubuntu-latest | |
env: | |
CODE_PATH: "./Runtime" | |
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 |